How to make 'simple SSL' thru Web Services?

后端 未结 5 408
栀梦
栀梦 2020-12-15 01:31

I know how to secure Web Services using certificates. that\'s my client code:

  SSLContext ssl = SSLContext.getInstance(\"SSLv3\");
  KeyManagerFactory kmf =         


        
5条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-15 02:16

    Java Runtime Environment does come with a lots (most widely used) Certificate Authorities in cacerts file. If the certificate you used to secure your service is signed by one of those root CAs, then you need not worry about sharing any certificate with clients.

    However if you used self-signed certificate, and you don't want to pass/import certificate in truststore then you can implement custom X509TrustManager and create custom SSLContext for your connections. More details in this blog.

    Self-signed certificate are useful for development and test environments but you really should consider getting your server certificate signed from a recognized Certificate Authority like Verisign, Thwate etc.

提交回复
热议问题