Skip to content

feature(SSLConnectionSocketFactory): Pass HttpContext to prepareSocket method#404

Merged
ok2c merged 6 commits intoapache:masterfrom
alturkovic:master
Jan 4, 2023
Merged

feature(SSLConnectionSocketFactory): Pass HttpContext to prepareSocket method#404
ok2c merged 6 commits intoapache:masterfrom
alturkovic:master

Conversation

@alturkovic
Copy link
Copy Markdown
Contributor

Some implementations might depend on a variable present in the HttpContext which is available in most other methods.

@ok2c
Copy link
Copy Markdown
Member

ok2c commented Jan 4, 2023

@alturkovic The change-set breaks backward compatibility with 5.0 APIs.

By the way, one may be better off writing a custom SSLConnectionSocketFactory instead of trying to make the default one work in all specific cases.

[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time:  46.847 s
[INFO] Finished at: 2023-01-04T13:46:47Z
[INFO] ------------------------------------------------------------------------
Error:  Failed to execute goal com.github.siom79.japicmp:japicmp-maven-plugin:0.16.0:cmp (default) on project httpclient5: There is at least one incompatibility: org.apache.hc.client5.http.ssl.SSLConnectionSocketFactory.prepareSocket(javax.net.ssl.SSLSocket):METHOD_REMOVED -> [Help 1]

@alturkovic
Copy link
Copy Markdown
Contributor Author

@ok2c Oops, added the method back. I understand, I just thought that having HttpContext available by default made sense.

@ok2c
Copy link
Copy Markdown
Member

ok2c commented Jan 4, 2023

@alturkovic Please deprecate the old method in favor of the new one.

@ok2c
Copy link
Copy Markdown
Member

ok2c commented Jan 4, 2023

@alturkovic Great. But please do it nicely and suppress deprecation warnings in the new method.

@alturkovic
Copy link
Copy Markdown
Contributor Author

Sorry, I do not know what you mean by that, I took a look how other methods are deprecated (i.e.: org.apache.hc.client5.http.ssl.ClientTlsStrategyBuilder#setTlsDetailsFactory) and I do not see any suppressions? Would you mind explaining a bit more what needs to be done?

@ok2c
Copy link
Copy Markdown
Member

ok2c commented Jan 4, 2023

@alturkovic Please add @SuppressWarnings("deprecation") annotation to the new method.

@ok2c ok2c merged commit d2016ea into apache:master Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants