https URL hostname not matching Common Name (CN) despite setting 'disableCNCheck' to true

前端 未结 3 1796
情深已故
情深已故 2020-12-31 13:32

I managed to configure my CXF-based client properly so that it finds the correct SSL certificate for the server on which I am running a web service:

  

        
3条回答
  •  时光取名叫无心
    2020-12-31 14:33

    Add below code to set disableCNCheck

     HTTPConduit httpConduit=(HTTPConduit)ClientProxy.getClient(port).getConduit();
            TLSClientParameters tlsCP = new TLSClientParameters();
            tlsCP.setDisableCNCheck(true);
            httpConduit.setTlsClientParameters(tlsCP);
    

    Use this code only in the lower environments, In higher environments, it's not recommended.

提交回复
热议问题