Venki Korukanti created THRIFT-2122:
---------------------------------------
Summary: 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
Affects Versions: 0.9
Reporter: Venki Korukanti
Fix For: 0.9.1, 1.0, 1.1, 1.2
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 is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira