On Tue, 16 Feb 2021 07:50:05 GMT, Vyom Tewari <[email protected]> wrote:
> HttpsURLConnection, works with SunJSSE provider but does not work with other
> JSSE provider. In case of SunJSSE , HttpsURLConnection set the host name as
> follows
>
> s = (SSLSocket)serverSocket;
> if (s instanceof SSLSocketImpl) {
> ((SSLSocketImpl)s).setHost(host);
> }
Did you copy the code/lines above from
src/java.base/share/classes/sun/net/www/protocol/https/HttpsClient.java? This
is the file you updated in the pull request. If I read the updated file right,
the line numbers are from 455 to 458. If the socket is an instance of
SSLSocketImpl, the host is set here.
>
> But in case of other providers(BouncyCastleProvider ) host will not get set
> and "java.security.cert.CertificateException: No subject alternative name
> found matching IP address" exception will be thrown.
>
-------------
PR: https://git.openjdk.java.net/jdk/pull/2583