Note that there are some explanatory texts on larger screens.

plurals
  1. POOpenSSL C++ server + Java client : get "alert certificate unknown" error
    primarykey
    data
    text
    <p>I have created a C++ server and client using OpenSSL. I have set up a root certificate from which i have signed a client and a server certificate. Everything works fine I can connect and send data both ways. </p> <p>I then made a client application in Java. Followed this tutorial to make a JKS certificate out of my clientcert.pem and clientkey.pem <a href="http://www.agentbob.info/agentbob/79-AB.html" rel="nofollow">http://www.agentbob.info/agentbob/79-AB.html</a></p> <p>jave code looks like this:</p> <pre><code> SSLSocketFactory factory = null; try { SSLContext ctx; KeyManagerFactory kmf; KeyStore ks; char[] passphrase = "android".toCharArray(); ctx = SSLContext.getInstance("TLS"); kmf = KeyManagerFactory.getInstance("SunX509"); ks = KeyStore.getInstance("JKS"); ks.load(new FileInputStream("keystore.ImportKey"), passphrase); kmf.init(ks, passphrase); ctx.init(kmf.getKeyManagers(), null, null); factory = ctx.getSocketFactory(); } catch (Exception e) { e.printStackTrace(); } SSLSocket socket; try { socket = (SSLSocket) factory.createSocket("server", 10443); PrintWriter out; out = new PrintWriter(new BufferedWriter(new OutputStreamWriter( socket.getOutputStream()))); out.println("Hello from SSL client!"); out.println(); out.flush(); out.close(); socket.close(); } catch (IOException e) { e.printStackTrace(); } </code></pre> <p>However when it tries to connect i get an error in my C++ server when calling SSL_accept(ssl). I checked the error and it prints out: error:14094416:SSL routines:SSL3_READ_BYTES:sslv3 alert certificate unknown</p> <p>Any idea why the certificate fails? Is there any tutorial anywhere that shows how to create certificates for both OpenSSL and java?</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    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. This table or related slice is empty.
    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