No name matching localhost found

You may also like to read:

To fix it, add a method to override the existing hostname verifier like this :

Before having a look at this issue resolver, go through the tutorial using SSL with jax-ws webservice

import com.roytuts.service.Hello;

import javax.xml.namespace.QName;
public class HelloSSLClient{
    static {
        //for localhost testing only
            public boolean verify(String hostname,
           sslSession) {
                if (hostname.equals("localhost")) {
                    return true;
                return false;
    public static void main(String[] args) throws Exception {
        URL url = new URL("https://localhost:8443/jax-ws-ssl/hello?wsdl");
        QName qname = new QName("",
        Service service = Service.create(url, qname);
        Hello hello = service.getPort(Hello.class);


Hello Soumitra


It’s working fine now. No name matching localhost found
I am a professional Web developer, Enterprise Application developer, Software Engineer and Blogger and writing blogs is my passion. Connect me on Roy Tutorials | Twitter | Facebook | Linkedin | Reddit | Ello | Tumblr

Leave a Reply

Your email address will not be published. Required fields are marked *

Scroll to top