WebService interfaces in Java access EJBCA at this stage

  • liwf

    liwf - 2014-05-21

    I have create client keyStore and certificate in my EJBCA publick Web,and in my java code I use it like this:
    Provider tlsProvider = new TLSProvider();
    Security.setProperty("ssl.TrustManagerFactory.algorithm", "AcceptAll");
    Security.setProperty("ssl.KeyManagerFactory.algorithm", "NewSunX509");

        String urlstr = "";
        //System.setProperty("javax.net.ssl.keyStoreType", "jks");
        System.setProperty("javax.net.ssl.keyStorePassword", "111111");
        QName qname = new QName("http://ws.protocol.core.ejbca.org/","EjbcaWSService");
        EjbcaWSService service = null;
        try {
            service = new EjbcaWSService(new URL(urlstr), qname);
        } catch (MalformedURLException e1) {
        EjbcaWS ws = service.getEjbcaWSPort();

    but it always has Caused by: java.io.IOException: HTTPS hostname wrong: should be <>
    or Caused by: java.security.cert.CertificateException: No subject alternative names present
    can someBody tell me why,I didn't get rid of for a few days, is to add the client's certificate to the server trustStore?

  • Anders Rundgren

    Anders Rundgren - 2014-05-21

    The TLS server certificate is invalid. A better solution is creating a real TLS certificate than trying to get around the problem.

    give the host a proper name and put the IP in "hosts" file to begin with.


    • liwf

      liwf - 2014-05-24

      Now, I want to use EJBCA WebService interface in java code, but after I installed ejbca at this stage,I don't know what to do? Should i use the WEB GUI to create a CA certificate 、keyStore and trustStore then set them in my java code? Can you tell me what should i do?


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

JavaScript is required for this form.

No, thanks