Topic
  • No replies
SystemAdmin
SystemAdmin
2736 Posts

Pinned topic nullpointer at SSLSocketFactory.createSocket(SSLSocketFactory.java:362)

‏2013-02-19T00:46:22Z |
I am attempting to make a HTTPS Post calls from my server:

In the below line I get a NullPointer.

URL url = null;
HttpsURLConnection conn = null;
try {

url = new URL(enrollmentSSOURL);

conn = (HttpsURLConnection)url.openConnection();

conn.setDoInput (true);
conn.setDoOutput (true);
conn.setUseCaches (false);
conn.setRequestMethod("POST");

conn.setConnectTimeout(Integer.parseInt(connectTimeout));
conn.setReadTimeout(Integer.parseInt(readTimeout));
DataOutputStream output = new DataOutputStream(conn.getOutputStream()); ->fails here w/null

stack trace:
2/18/13 15:35:05:348 CST 00000027 SystemErr R java.lang.NullPointerException
2/18/13 15:35:05:349 CST 00000027 SystemErr R at com.ibm.websphere.ssl.protocol.SSLSocketFactory.createSocket(SSLSocketFactory.java:362)
2/18/13 15:35:05:349 CST 00000027 SystemErr R at com.ibm.net.ssl.www2.protocol.https.b.afterConnect(b.java:39)
2/18/13 15:35:05:349 CST 00000027 SystemErr R at com.ibm.net.ssl.www2.protocol.https.c.connect(c.java:70)
2/18/13 15:35:05:350 CST 00000027 SystemErr R at sun.net.www.protocol.http.HttpURLConnection.getOutputStream(HttpURLConnection.java:1040)
2/18/13 15:35:05:350 CST 00000027 SystemErr R at com.ibm.net.ssl.www2.protocol.https.a.getOutputStream(a.java:51)