You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Andrew Gaul (JIRA)" <ji...@apache.org> on 2013/10/28 18:40:34 UTC

[jira] [Commented] (THRIFT-2122) NPE in TSSLTransportFactory.createClient when no truststore password is passed in custom SSL params

    [ https://issues.apache.org/jira/browse/THRIFT-2122?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13806977#comment-13806977 ] 

Andrew Gaul commented on THRIFT-2122:
-------------------------------------

+1, KeyStoreSpi.engineLoad specifies null password when not checking the integrity or unlocking the keystore.

> NPE in TSSLTransportFactory.createClient when no truststore password is passed in custom SSL params
> ---------------------------------------------------------------------------------------------------
>
>                 Key: THRIFT-2122
>                 URL: https://issues.apache.org/jira/browse/THRIFT-2122
>             Project: Thrift
>          Issue Type: Bug
>          Components: Java - Library
>    Affects Versions: 0.9
>            Reporter: Venki Korukanti
>             Fix For: 1.0
>
>         Attachments: THRIFT-2122-ssl-npe-fix.patch
>
>
> Following code to get the SSL client transport with custom parameters return NPE. Truststore password is optional, but thrift code always expects a truststore password. Attached test code with the patch.
> {code}
>     TSSLTransportFactory.TSSLTransportParameters params = new
>       TSSLTransportFactory.TSSLTransportParameters();
>     params.setTrustStore(System.getProperty("javax.net.ssl.trustStore"), null);
>     return TSSLTransportFactory.getClientSocket(HOST, PORT, 0/*timeout*/, params);
> {code}
> Exception:
> {code}
> Error creating the transport
> org.apache.thrift.transport.TTransportException: Error creating the transport
>         at org.apache.thrift.transport.TSSLTransportFactory.createSSLContext(TSSLTransportFactory.java:201)
>         at org.apache.thrift.transport.TSSLTransportFactory.getClientSocket(TSSLTransportFactory.java:165)
>         at org.apache.thrift.transport.TestTSSLTransportFactoryCustomClient2.getClientTransport(TestTSSLTransportFactoryCustomClient2.java:32)
>         at org.apache.thrift.server.ServerTestBase.testIt(ServerTestBase.java:387)
> Caused by: java.lang.NullPointerException
>         at org.apache.thrift.transport.TSSLTransportFactory.createSSLContext(TSSLTransportFactory.java:179)
> {code}



--
This message was sent by Atlassian JIRA
(v6.1#6144)