Taylor_Pack
15 years agoOccasional Contributor
REST Calls with SSL + Basic Auth Fail on OS X
Hello,
My colleagues and I are trying to setup a SoapUI project that works with a REST service behind SSL and Basic Authentication. Essentially we want to emulate this cURL request in SoapUI:
curl -u"user:pass" https://example.com:443/object/method?query=abc123
We're having trouble, so I'll provide replication details and the stack trace below...
To set up the request I follow these steps:
1) Create a new project
2) Create a new REST service
3) Add the basic authentication details to the service under the Service Endpoints tab
4) Create a new Child Resource for "object"
5) Create a new Child Resource for "method" that accepts "query"
6) Create a GET request under "method"
To test it I follow these steps:
1) Open the GET request from step (6) above
2) Type in "abc123" for the query inside the test step
3) Click the play button to execute the request
This results in the following stack trace:
Important information:
* This occurs on Mac OS X 10.6.4 using the latest stable build of SoapUI Pro (3.6.1)
* We tried these same steps on a separate Mac OS X machine (also 10.6.4) and the same problem occurred
* We tried these same steps on an Ubuntu Linux machine and the service call worked properly and returned the correct results
* We're absolutely sure that the service endpoint used "https" in all tests we've run; we weren't accidentally using "http"
* The service endpoint definitely allows "https" as verified using cURL and the Linux test we ran
* We tried putting the basic authentication details under the Auth tab in the request itself instead of the adding them to the Service Endpoints tab on the REST service, but the same results occurred on Mac OS X
* We have successfully used HTTPS in other service calls from SoapUI as well as REST and Basic Authentication, just never this specification combination of all 3
* Someone reported the same problem here, but there was no officially documented resolution: https://www.eviware.com/forum/viewtopic.php?f=5&t=5477
Conclusions:
This seems to be either an issue with the Mac OS X SoapUI build or a problem with the Java libraries SoapUI is trying to access in Mac's Java distribution. Could someone from Eviware replicate this issue and see if we can get an answer and a solution?
Thanks!
My colleagues and I are trying to setup a SoapUI project that works with a REST service behind SSL and Basic Authentication. Essentially we want to emulate this cURL request in SoapUI:
curl -u"user:pass" https://example.com:443/object/method?query=abc123
We're having trouble, so I'll provide replication details and the stack trace below...
To set up the request I follow these steps:
1) Create a new project
2) Create a new REST service
3) Add the basic authentication details to the service under the Service Endpoints tab
4) Create a new Child Resource for "object"
5) Create a new Child Resource for "method" that accepts "query"
6) Create a GET request under "method"
To test it I follow these steps:
1) Open the GET request from step (6) above
2) Type in "abc123" for the query inside the test step
3) Click the play button to execute the request
This results in the following stack trace:
Thu Feb 03 14:38:42 CST 2011:ERROR:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:523)
at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:355)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:798)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1138)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(SSLSocketImpl.java:632)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(AppOutputStream.java:59)
at java.io.BufferedOutputStream.flushBuffer(BufferedOutputStream.java:65)
at java.io.BufferedOutputStream.flush(BufferedOutputStream.java:123)
at org.apache.commons.httpclient.HttpConnection.flushRequestOutputStream(HttpConnection.java:828)
at com.eviware.soapui.impl.wsdl.support.http.SoapUIMultiThreadedHttpConnectionManager$HttpConnectionAdapter.flushRequestOutputStream(SoapUIMultiThreadedHttpConnectionManager.java:1950)
at org.apache.commons.httpclient.HttpMethodBase.writeRequest(HttpMethodBase.java:2116)
at com.eviware.soapui.impl.wsdl.submit.transports.http.support.methods.ExtendedGetMethod.writeRequest(ExtendedGetMethod.java:88)
at org.apache.commons.httpclient.HttpMethodBase.execute(HttpMethodBase.java:1096)
at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:398)
at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:171)
at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:397)
at com.eviware.soapui.impl.wsdl.submit.transports.http.HttpClientRequestTransport.sendRequest(HttpClientRequestTransport.java:194)
at com.eviware.soapui.impl.wsdl.WsdlSubmit.run(WsdlSubmit.java:123)
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:441)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:303)
at java.util.concurrent.FutureTask.run(FutureTask.java:138)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:886)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:908)
at java.lang.Thread.run(Thread.java:680)
Important information:
* This occurs on Mac OS X 10.6.4 using the latest stable build of SoapUI Pro (3.6.1)
* We tried these same steps on a separate Mac OS X machine (also 10.6.4) and the same problem occurred
* We tried these same steps on an Ubuntu Linux machine and the service call worked properly and returned the correct results
* We're absolutely sure that the service endpoint used "https" in all tests we've run; we weren't accidentally using "http"
* The service endpoint definitely allows "https" as verified using cURL and the Linux test we ran
* We tried putting the basic authentication details under the Auth tab in the request itself instead of the adding them to the Service Endpoints tab on the REST service, but the same results occurred on Mac OS X
* We have successfully used HTTPS in other service calls from SoapUI as well as REST and Basic Authentication, just never this specification combination of all 3
* Someone reported the same problem here, but there was no officially documented resolution: https://www.eviware.com/forum/viewtopic.php?f=5&t=5477
Conclusions:
This seems to be either an issue with the Mac OS X SoapUI build or a problem with the Java libraries SoapUI is trying to access in Mac's Java distribution. Could someone from Eviware replicate this issue and see if we can get an answer and a solution?

Thanks!