Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>You need to create a trust store file for your self-signed certificate as described <a href="http://download.oracle.com/javase/6/docs/technotes/guides/security/jsse/JSSERefGuide.html#CreateKeystore" rel="nofollow noreferrer">here</a>. Use it on the client side to connect with your server. It doesn't really matter if you use JKS or another format, I'll assume JKS for now. </p> <p>To accomplish what you have in mind you need a different <code>TrustManager</code>, obviously. You can use <code>TrustManagerFactory</code> and feed its trust settings with your newly created trust store.</p> <pre><code>TrustManagerFactory tmf = TrustManagerFactory.getInstance("PKIX"); KeyStore ks = KeyStore.getInstance("JKS"); FileInputStream in = new FileInputStream("&lt;path to your key store&gt;"); ks.load(in, "password".toCharArray()); in.close(); tmf.init(ks); TrustManager[] tms = tmf.getTrustManagers(); </code></pre> <p>Use <code>tms</code> to init your <code>SSLContext</code>instead for the new trust settings to be used for your SSL/TLS connection. </p> <p>Also you should make sure that the <code>CN</code> part of the server TLS certificate is equal to the FQDN (fully qualified domain name) of your server, e.g. if your server base URL is '<a href="https://www.example.com" rel="nofollow noreferrer">https://www.example.com</a>', then the <code>CN</code> of the certificate should be 'www.example.com'. This is needed for host name verification, a feature that prevents man-in-the-middle-attacks. You could disable this, but only when using this your connection will be really secure. </p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload