Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

(I am reposting this question from stackoverflow. If there is some way that I can join the questions or just move the question please let me know. Thanks.)

I am attempting to convert a http webservice to https. I added the tags to the webservice.

@SecurityDomain(value = "jbossws-ssl")


@WebContext(contextRoot="/common/ws",  // already here
 urlPattern="/A2",   // already here
    authMethod = "CLIENT-CERT",  // added
    transportGuarantee = "CONFIDENTIAL") // added

But when my client trys to connect to https://host:80/path/to/ws I get an exception:

Caused by: HTTPS hostname wrong: should be <host>.

( entire thing shown below). I suspect that this has to do with the certificate that is being used. I think that I need to use the java keytool to resolve this. If someone could verify for me it would be greatly appreciated.

javax.xml.soap.SOAPException: Could not transmit message
        at com.alcatel.tpapps.common.utils.SOAPClient.execute(
        at com.alcatel.tpapps.common.utils.SOAPClient.main(
Caused by: Could not transmit message
        ... 3 more
Caused by: org.jboss.remoting.CannotConnectException: Can not connect http client invoker. HTTPS hostname wrong:  should be <host>.
        at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(
        at org.jboss.remoting.transport.http.HTTPClientInvoker.transport(
        at org.jboss.remoting.MicroRemoteClientInvoker.invoke(
        at org.jboss.remoting.Client.invoke(
        at org.jboss.remoting.Client.invoke(
        ... 5 more
Caused by: HTTPS hostname wrong:  should be <host>
        at org.jboss.remoting.transport.http.HTTPClientInvoker.useHttpURLConnection(
        ... 10 more

Update 1

I tried the following but it had no effect on the exception:

host[user:/path][525]% keytool -genkey -keystore server.keystore -alias host

Update 2

Actually not sure what I did in Update 1 was right because I did not have to specify a host name there...

share|improve this question
up vote 1 down vote accepted

the error message is complaining about your port. http normally runs on port 80 and https on port 443. you are trying to use https on port 80. change your call from




this will automatically use port 443 for the https connection.

share|improve this answer
@Christian, thanks for the comment. I think right now I am using port 8443. But I am getting the same error. I think that 8443 is also acceptable for https? – sixtyfootersdude Feb 4 '10 at 14:47
sure, it is the default tomcat ssl port. did you change your url to https://sco-up:8443/path/to/ws? – Christian Feb 4 '10 at 14:54
what you did in update1 was generating a key with alias sco-up. what you should have done is generate a certificate with alias sco-up. this alias has to match the hostname. here are two links: how to create a self-signed certificate: and how to import it into a java keystore:… – Christian Feb 4 '10 at 15:00

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.