mirror of
https://github.com/apache/httpcomponents-client.git
synced 2025-02-17 07:26:47 +00:00
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 Object getUserToken(final HttpContext context) {
|
||||
|
||||
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…
x
Reference in New Issue
Block a user