SSL client certificate in Maven

前端 未结 2 1431
臣服心动
臣服心动 2020-12-02 01:21

I use the \"maven-jaxb22-plugin\" to generate classes so I can call a web service written in .Net. Usually it works fine but this time, I can only access the WSDL using a cl

2条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-02 01:41

    You could use maven propety configuration to setup Java System properties. Be careful to set "keyStore" not "trustStore".

    Also, if you are using a certificate that it's not from a valid CA you have to configure maven.wagon.http.ssl.insecure=true and maven.wagon.http.ssl.allowall=true

    In your case use:

    ..
    
        
            
                generate
            
            
                
                    
                        javax.net.ssl.keyStore
                        yourks.jks
                    
                    
                        javax.net.ssl.keyStoreType
                        jks
                    
                    
                        javax.net.ssl.keyStorePassword
                        changeit
                    
                    
                        maven.wagon.http.ssl.insecure
                        true
                    
                    
                        maven.wagon.http.ssl.allowall
                        true
                    
                
            
        
    
    ..
    

提交回复
热议问题