--- old/src/java.base/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java 2018-11-01 09:25:32.151225900 -0700 +++ new/src/java.base/share/classes/sun/net/www/protocol/https/AbstractDelegateHttpsURLConnection.java 2018-11-01 09:25:30.834956500 -0700 @@ -1,5 +1,5 @@ /* - * Copyright (c) 2001, 2015, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2001, 2018, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -31,6 +31,7 @@ import java.security.Principal; import java.io.IOException; import java.util.List; +import javax.net.ssl.SSLSession; import javax.net.ssl.SSLPeerUnverifiedException; import sun.net.www.http.*; import sun.net.www.protocol.http.HttpURLConnection; @@ -296,4 +297,15 @@ } } + SSLSession getSSLSession() { + if (cachedResponse != null) { + return ((SecureCacheResponse)cachedResponse).getSSLSession(); + } + + if (http == null) { + throw new IllegalStateException("connection not yet open"); + } + + return ((HttpsClient)http).getSSLSession(); + } }