HTTPCLIENT-1287: DefaultUserTokenHandler#getUserToken to check if the connection is open prior to retrieving SSLSession.
Contributed by Noah Levitt <nlevitt at gmail.com> git-svn-id: https://svn.apache.org/repos/asf/httpcomponents/httpclient/trunk@1427541 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
9ec0c13594
commit
c02e1b3f75
|
@ -76,7 +76,7 @@ public class DefaultUserTokenHandler implements UserTokenHandler {
|
|||
|
||||
if (userPrincipal == null) {
|
||||
HttpConnection conn = clientContext.getConnection();
|
||||
if (conn instanceof SocketClientConnection) {
|
||||
if (conn.isOpen() && conn instanceof SocketClientConnection) {
|
||||
SSLSession sslsession = ((SocketClientConnection) conn).getSSLSession();
|
||||
if (sslsession != null) {
|
||||
userPrincipal = sslsession.getLocalPrincipal();
|
||||
|
|
Loading…
Reference in New Issue