You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by st...@bt.com on 2007/08/23 14:58:59 UTC

[axis2] AxisFault "Transport out has not been set" with self signed certificates

I have been having a problem getting my client application to work
against a server that uses an SSL connector and self-signed
certificates.

I get this error raised whenever I connect to the SSL port, the standard
port works fine.

Caught org.apache.axis2.AxisFault: Transport out has not been set
org.apache.axis2.AxisFault: Transport out has not been set
    at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:383)
    at
org.apache.axis2.description.OutInAxisOperationClient.send(OutInAxisOper
ation.java:374)
    ...

I have used the method outlined in the httpclient SSL guide to overcome
the problem of the self-signed certificates raising a security error.
This registering a new protocol and creating a customised socketFactory
to support this protocol. This means I send my requests to
"myssl://localhost/" instead of "https://localhost:8443/".

My thought is that I should create a transportSender for the new
protocol but I am not clear from the documentation how to do this,
either with an axis2.xml file or progammatically (which I would prefer).
I have tried adding my own minimal axis2.xml file with just a
transportSender in, but it does not seem to work. I am not sure if my
application is loading the axis2.xml file.

Can anybody point me in the right direction? I have created a test case
based on the StockQuoteService sample. I have attached it. Once opened
type "ant help" for more information.

I am using axis2 1.3

Steve Hindmarch

BT Design - iBridge Development

RE: [axis2] AxisFault "Transport out has not been set" with self signed certificates

Posted by st...@bt.com.
Looking at the source for CommonsHTTPTransportSender method
writeMessageWithCommons the first thing it does is to form a
java.net.URL from the service address ("myssl://localhost/axis2/...").
This causes a java.net.MalformedURLException to be thrown, which is
caught and rethrown as the AxisFault that I am seeing.

So java.net.URL knows nothing at this point about my newly registered
protocol "myssl".

Googling suggests I need to register a protocol handler by setting the
system property "java.protocol.handler.pkgs" with the class name of an
appropriate handler.

Now I had expected that this would have happened for me by calling
org.apache.commons.httpclient.protocol.Protocol.registerProtocol(...).

So have I missed a configuration step that sets up an appropriate
protocol handler that knows about the httpclient Protocol registration,
or is it a bug in CommonsHTTPTransportSender to use java.net.URL instead
of something provided by the httpclient package or the more general
java.net.URI?

Steve Hindmarch

One IT - iBridge Development

> -----Original Message-----
> From: stephen.hindmarch@bt.com [mailto:stephen.hindmarch@bt.com] 
> Sent: 23 August 2007 17:39
> To: axis-user@ws.apache.org
> Subject: RE: [axis2] AxisFault "Transport out has not been 
> set" with self signed certificates
> 
> I advanced a bit by adding the transport sender with these lines
> 
> 	TransportSender tSender=new CommonsHTTPTransportSender();
> 	TransportOutDescription tOutDesc=new
> TransportOutDescription("myssl");
> 	tOutDesc.setSender(tSender);
> 	tOutDesc.addParameter(
> 	    new Parameter(
> 		HTTPConstants.PROTOCOL_VERSION
> 		,HTTPConstants.HEADER_PROTOCOL_11));
> 	tOutDesc.addParameter(new
> Parameter("Transfer-Encoding","chunked"));
> 	ServiceClient serviceClient=stub._getServiceClient();
> 	AxisConfiguration
> axisConfig=serviceClient.getAxisConfiguration();
> 	axisConfig.addTransportOut(tOutDesc);
> 
> This time I got the following exception:-
> 
> Caught org.apache.axis2.AxisFault: unknown protocol: myssl
> org.apache.axis2.AxisFault: unknown protocol: myssl
> 	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
> 	at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.wri
> teMessageW
> ithCommons(CommonsHTTPTransportSender.java:330)
>  	at
> org.apache.axis2.transport.http.CommonsHTTPTransportSender.inv
> oke(Common
> sHTTPTransportSender.java:206)
> 	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)
> 
> Which ties in with something in another thread
> http://mail-archives.apache.org/mod_mbox/ws-axis-user/200704.m
> box/%3c100
> 24008.post@talk.nabble.com%3e
> 
> It suggests that the CommonsHTTPTransportSender ignores the newly
> registered protocol "myssl" and so cannot find the custom socket
> factory. Is this a bug?
> 
> The workaround is to register the protocol against "https", 
> which allows
> the transport sender to find the socket factory, but this is not
> satisfactory as I may not want to use the custom (and rather insecure)
> socket factory in all cases.
> 
> Steve Hindmarch
> 
> One IT - iBridge Development
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org


RE: [axis2] AxisFault "Transport out has not been set" with self signed certificates

Posted by st...@bt.com.
I advanced a bit by adding the transport sender with these lines

	TransportSender tSender=new CommonsHTTPTransportSender();
	TransportOutDescription tOutDesc=new
TransportOutDescription("myssl");
	tOutDesc.setSender(tSender);
	tOutDesc.addParameter(
	    new Parameter(
		HTTPConstants.PROTOCOL_VERSION
		,HTTPConstants.HEADER_PROTOCOL_11));
	tOutDesc.addParameter(new
Parameter("Transfer-Encoding","chunked"));
	ServiceClient serviceClient=stub._getServiceClient();
	AxisConfiguration
axisConfig=serviceClient.getAxisConfiguration();
	axisConfig.addTransportOut(tOutDesc);

This time I got the following exception:-

Caught org.apache.axis2.AxisFault: unknown protocol: myssl
org.apache.axis2.AxisFault: unknown protocol: myssl
	at org.apache.axis2.AxisFault.makeFault(AxisFault.java:417)
	at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.writeMessageW
ithCommons(CommonsHTTPTransportSender.java:330)
 	at
org.apache.axis2.transport.http.CommonsHTTPTransportSender.invoke(Common
sHTTPTransportSender.java:206)
	at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:396)

Which ties in with something in another thread
http://mail-archives.apache.org/mod_mbox/ws-axis-user/200704.mbox/%3c100
24008.post@talk.nabble.com%3e

It suggests that the CommonsHTTPTransportSender ignores the newly
registered protocol "myssl" and so cannot find the custom socket
factory. Is this a bug?

The workaround is to register the protocol against "https", which allows
the transport sender to find the socket factory, but this is not
satisfactory as I may not want to use the custom (and rather insecure)
socket factory in all cases.

Steve Hindmarch

One IT - iBridge Development

> -----Original Message-----
> From: stephen.hindmarch@bt.com [mailto:stephen.hindmarch@bt.com] 
> Sent: 23 August 2007 13:59
> To: axis-user@ws.apache.org
> Subject: [axis2] AxisFault "Transport out has not been set" 
> with self signed certificates
> 
> I have been having a problem getting my client application to work
> against a server that uses an SSL connector and self-signed
> certificates.
> 
> I get this error raised whenever I connect to the SSL port, 
> the standard
> port works fine.
> 
> Caught org.apache.axis2.AxisFault: Transport out has not been set
> org.apache.axis2.AxisFault: Transport out has not been set
>     at org.apache.axis2.engine.AxisEngine.send(AxisEngine.java:383)
>     at
> org.apache.axis2.description.OutInAxisOperationClient.send(Out
> InAxisOper
> ation.java:374)
>     ...
> 
> I have used the method outlined in the httpclient SSL guide 
> to overcome
> the problem of the self-signed certificates raising a security error.
> This registering a new protocol and creating a customised 
> socketFactory
> to support this protocol. This means I send my requests to
> "myssl://localhost/" instead of "https://localhost:8443/".
> 
> My thought is that I should create a transportSender for the new
> protocol but I am not clear from the documentation how to do this,
> either with an axis2.xml file or progammatically (which I 
> would prefer).
> I have tried adding my own minimal axis2.xml file with just a
> transportSender in, but it does not seem to work. I am not sure if my
> application is loading the axis2.xml file.
> 
> Can anybody point me in the right direction? I have created a 
> test case
> based on the StockQuoteService sample. I have attached it. Once opened
> type "ant help" for more information.
> 
> I am using axis2 1.3
> 
> Steve Hindmarch
> 
> BT Design - iBridge Development
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: axis-user-unsubscribe@ws.apache.org
For additional commands, e-mail: axis-user-help@ws.apache.org