users@glassfish.java.net

How to setHostNameVerifier on a web service running from glassfish

From: <glassfish_at_javadesktop.org>
Date: Thu, 07 Oct 2010 12:36:49 PDT

Hello.

how to you set the HostNameVerifier with a Web Service Client running within a EJB on a glassfish Server.

I have tried the following but it does not appear to work. I need to to this because the client certificate used is a wildcard certificate and GF does not appear to like it.

private String getServerStatus() {
       GatewaySoap port = service.getGatewaySoap();
        MyHostnameVerifier hostNameVerifier = new MyHostnameVerifier();
                ((BindingProvider) port).getRequestContext().
                        put(JAXWSProperties.HOSTNAME_VERIFIER, hostNameVerifier);
        return port.getServerStatus();
    }

class MyHostnameVerifier implements HostnameVerifier {

    public boolean verify(String string, SSLSession ssls) {
        return true;
    }
[Message sent by forum member 'dboileau']

http://forums.java.net/jive/thread.jspa?messageID=484570