arturobernalg commented on code in PR #407:
URL:
https://github.com/apache/httpcomponents-core/pull/407#discussion_r1209400349
##########
httpcore5/src/main/java/org/apache/hc/core5/reactor/ssl/SSLIOSession.java:
##########
@@ -424,9 +424,18 @@ private void doHandshake(final IOSession protocolSession)
throws IOException {
if (this.verifier != null) {
this.tlsDetails = this.verifier.verify(this.targetEndpoint,
this.sslEngine);
}
+ String applicationProtocol;
if (this.tlsDetails == null) {
final SSLSession sslSession = this.sslEngine.getSession();
- final String applicationProtocol =
this.sslEngine.getApplicationProtocol();
+ try {
+ applicationProtocol =
this.sslEngine.getApplicationProtocol();
+ } catch (final UnsupportedOperationException e) {
+ // If the underlying provider does not support the
operation, the getApplicationProtocol() method throws an
UnsupportedOperationException.
+ // In this case, we fall back to "http/1.1" as the
application protocol.
+ // This is a workaround to allow older applications that
do not support the getApplicationProtocol() method to continue working.
+ // This workaround is temporary and is meant to maintain
compatibility with older systems.
+ applicationProtocol = "http/1.1";
Review Comment:
> @arturobernalg Could you please use `ApplicationProtocol` enum here?
@ok2c
Yes, I noticed that Enum, but I can't include it because it would create a
circular dependency between modules. I'm unsure if it's worth refactoring
several classes and moving them to the base module to resolve this.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]