Capturing traffic between local webservice and external ssl based webservice
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-09-2009
03:19 PM
10-09-2009
03:19 PM
Capturing traffic between local webservice and external ssl based webservice
Hi Robert,
Consider a case where I am issuing a HTTP request to my webservice running on localhost:8080. This webservice then in turn sends HTTPS request to an external webservice. I want to monitor traffic between our localhost:8080 and external webservice. I am trying to do this by setting up soapui monitor as a proxy running at localhost:8081. My local webservice is configured to send request to endpoint, say, https://www.abcd.com/soap/externalService using security certificate. My local service also uses concept of a proxy server and that is where I register localhost:8081 as a proxy server. I have setup soapui monitor at localhost:8081 using Http proxy method (not the tunnel method). When I set up this monitor I also gave it an incoming-ws config where I specify by signature certificate that is required by external web service.
Here is the problem:
When I issue the request to my local web service at localhost:8080, my webservice internally sends request to the proxy at localhost:8081. But then I receive a response back from localhost:8081 saying:
- I/O error: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?; nested exception is javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
org.springframework.ws.client.WebServiceIOException: I/O error: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?; nested exception is javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
I feel that proxy is having a plain socket and not able to send ssl message coming from my local web service on plain http proxy connection.
I also tried using http tunnel for this purpose where tunnel listens on localhost:8081 and my webservice is still configured to use localhost:8081 as proxy. In that case I get "connection refused error".
Any thoughts in getting this running?
Thanks in advance,
Sachin
Consider a case where I am issuing a HTTP request to my webservice running on localhost:8080. This webservice then in turn sends HTTPS request to an external webservice. I want to monitor traffic between our localhost:8080 and external webservice. I am trying to do this by setting up soapui monitor as a proxy running at localhost:8081. My local webservice is configured to send request to endpoint, say, https://www.abcd.com/soap/externalService using security certificate. My local service also uses concept of a proxy server and that is where I register localhost:8081 as a proxy server. I have setup soapui monitor at localhost:8081 using Http proxy method (not the tunnel method). When I set up this monitor I also gave it an incoming-ws config where I specify by signature certificate that is required by external web service.
Here is the problem:
When I issue the request to my local web service at localhost:8080, my webservice internally sends request to the proxy at localhost:8081. But then I receive a response back from localhost:8081 saying:
- I/O error: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?; nested exception is javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
org.springframework.ws.client.WebServiceIOException: I/O error: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?; nested exception is javax.net.ssl.SSLException: Connection has been shutdown: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
I feel that proxy is having a plain socket and not able to send ssl message coming from my local web service on plain http proxy connection.
I also tried using http tunnel for this purpose where tunnel listens on localhost:8081 and my webservice is still configured to use localhost:8081 as proxy. In that case I get "connection refused error".
Any thoughts in getting this running?
Thanks in advance,
Sachin
11 REPLIES 11
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
12:58 AM
10-12-2009
12:58 AM
Hello,
Well, yes proxy only handle plain http. Tunnel is one that can handle ssl. Idea is to make a tunnel be able to decode ssl and make it visible, which can not be done with proxy. Usage is also different, while to use proxy you need to set global preference proxy ( host, port, etc ), for tunnel you set port, end point and certificate in case you are using ssl( this is not necessary in case of plan http) and send request to tunnel not web service server. Tunnel will send request to ws server and get back to client( soapUI ).
So, to set up tunnel, set port ( ex. 8081 ), endpoint ( https://www.abcd.com/soap/externalService ) and certificates. Than send request to https://localhost:8081. That should be it..
Let me know does it helps,
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Well, yes proxy only handle plain http. Tunnel is one that can handle ssl. Idea is to make a tunnel be able to decode ssl and make it visible, which can not be done with proxy. Usage is also different, while to use proxy you need to set global preference proxy ( host, port, etc ), for tunnel you set port, end point and certificate in case you are using ssl( this is not necessary in case of plan http) and send request to tunnel not web service server. Tunnel will send request to ws server and get back to client( soapUI ).
So, to set up tunnel, set port ( ex. 8081 ), endpoint ( https://www.abcd.com/soap/externalService ) and certificates. Than send request to https://localhost:8081. That should be it..
Let me know does it helps,
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
06:38 AM
10-12-2009
06:38 AM
Hi Robert,
I tried this option. My request goes to my local webservice at http://localhost:8080. Then I can see in the logs that it is issuing request to external web service at http://www.abcd.com/soap/externalWebService with the message that is supposed to be sent to this service. At this point in time I get error
I/O error: Connection refused; nested exception is java.net.ConnectException: Connection refused
org.springframework.ws.client.WebServiceIOException: I/O error: Connection refused; nested exception is java.net.ConnectException: Connection refused
It appears that when issue request from my local webservice to an http tunnel monitor in soapui the monitor is not aware of how to handle it. However if I try the same thing (that is issuing of request to external web service) manually inside soapui where I issue soapui request with message to external web service and create soap monitor tunnel to external web service then that works as expected.
Any ideas why?
thanks,
Sachin
I tried this option. My request goes to my local webservice at http://localhost:8080. Then I can see in the logs that it is issuing request to external web service at http://www.abcd.com/soap/externalWebService with the message that is supposed to be sent to this service. At this point in time I get error
I/O error: Connection refused; nested exception is java.net.ConnectException: Connection refused
org.springframework.ws.client.WebServiceIOException: I/O error: Connection refused; nested exception is java.net.ConnectException: Connection refused
It appears that when issue request from my local webservice to an http tunnel monitor in soapui the monitor is not aware of how to handle it. However if I try the same thing (that is issuing of request to external web service) manually inside soapui where I issue soapui request with message to external web service and create soap monitor tunnel to external web service then that works as expected.
Any ideas why?
thanks,
Sachin
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
06:59 AM
10-12-2009
06:59 AM
Hello,
Hm..is there anything in error log? http log?
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Hm..is there anything in error log? http log?
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
07:10 AM
10-12-2009
07:10 AM
The error I typed is the error in my localhost tomcat log. But no error in soapui log. The error I get back in soapui is internal server error that is reported by my local host tomcat service.
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
07:22 AM
10-12-2009
07:22 AM
Hello,
Did you setup tunnel properly? How did you set tunnel port and endpoint? And what is local ws endpoint?
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Did you setup tunnel properly? How did you set tunnel port and endpoint? And what is local ws endpoint?
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
07:27 AM
10-12-2009
07:27 AM
Robert,
See here is what I feel but you can correct me if I am wrong. soap ui suggests that user point to localhost:8081 when 8081 tunnel is running as soapui monitor. This can perhaps work if you point to localhost:8081 and keeping rest of url for webservice same only if you do this from within soapui. I have tried this from one soapui to another soapui instance and that works too.
In this case what I doing is invoking tomcat localhost call to an ip:port/monitorServiceInSoapUI. Do you think this would work? Essentially can we invoke a call to soapui monitor running as tunnel and that call is invoked from external tomcat?
Attached is the snapshot of my tunnel setup.
Thanks,
Sachin
See here is what I feel but you can correct me if I am wrong. soap ui suggests that user point to localhost:8081 when 8081 tunnel is running as soapui monitor. This can perhaps work if you point to localhost:8081 and keeping rest of url for webservice same only if you do this from within soapui. I have tried this from one soapui to another soapui instance and that works too.
In this case what I doing is invoking tomcat localhost call to an ip:port/monitorServiceInSoapUI. Do you think this would work? Essentially can we invoke a call to soapui monitor running as tunnel and that call is invoked from external tomcat?
Attached is the snapshot of my tunnel setup.
Thanks,
Sachin
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
07:50 AM
10-12-2009
07:50 AM
Robert,
I just tried my exercise directly in soapui but soapui http tunnel monitor is not listening on localhost:8081. Is it possible that the bug you fixed earlier in order to get "tunnel > global proxy > external web service" could have created another bug? I ask this because I am using your nightly build as of october 9th. The one you suggested after you got "tunnel > global proxy > external service" thing working. And I do remember before I tried this build that my soapui tunnel monitor was working
Please let me know
Sachin
I just tried my exercise directly in soapui but soapui http tunnel monitor is not listening on localhost:8081. Is it possible that the bug you fixed earlier in order to get "tunnel > global proxy > external web service" could have created another bug? I ask this because I am using your nightly build as of october 9th. The one you suggested after you got "tunnel > global proxy > external service" thing working. And I do remember before I tried this build that my soapui tunnel monitor was working
Please let me know
Sachin
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
08:12 AM
10-12-2009
08:12 AM
Hello,
Hm..I just tried it and it works for me..One more question do have setup proxy? If you set up external proxy soapUI is trying to send request over it to your local tomcat...If this is case remove it or add server to exclude...
Let me know,
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Hm..I just tried it and it works for me..One more question do have setup proxy? If you set up external proxy soapUI is trying to send request over it to your local tomcat...If this is case remove it or add server to exclude...
Let me know,
robert
Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-12-2009
08:26 AM
10-12-2009
08:26 AM
No. I don't have proxy set up. What did you try? Did you try connection to external web service via http tunnel soap monitor and invoke this connection using a local webservice using local web server?
thanks,
Sachin
thanks,
Sachin
