We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://github.com/wuhongzhi/wildfly-openssl/blob/master/java/src/main/java/org/wildfly/openssl/OpenSSLContextSPI.java
/** * Setup the SSL_CTX * * @param kms Must contain a KeyManager of the type * {@code OpenSSLKeyManager} * @param tms */ private synchronized void init(KeyManager[] kms, TrustManager[] tms) throws KeyManagementException { if (initialized) { LOG.warning(Messages.MESSAGES.ignoringSecondInit()); return; } SSL_INSTANCE = SSL.getInstance(); try { // Load Server key and certificate X509KeyManager keyManager = chooseKeyManager(kms); if (keyManager != null) { for (String algorithm : ALGORITHMS) { final String[] aliases = keyManager.getServerAliases(algorithm, null); if (aliases != null && aliases.length != 0) { for(String alias: aliases) { X509Certificate[] certificates = keyManager.getCertificateChain(alias); if (certificates == null || certificates.length == 0) continue; byte[][] certs = new byte[certificates.length][]; int idx = 0; for (X509Certificate c: certificates) { certs[idx++] = c.getEncoded(); } PrivateKey key = keyManager.getPrivateKey(alias); if(key == null || key.getEncoded() == null) { continue; } if (LOG.isLoggable(Level.FINE)) { LOG.fine("Using alias " + alias + " for " + algorithm); } StringBuilder sb = new StringBuilder(String.format(BEGIN_CERT, algorithm)); sb.append(Base64.getMimeEncoder(64, new byte[]{'\n'}).encodeToString(key.getEncoded())); sb.append(String.format(END_CERT, algorithm)); switch (algorithm) { case "RSA": idx = SSL.SSL_AIDX_RSA; break; case "DSA": idx = SSL.SSL_AIDX_DSA; break; case "EC": idx = SSL.SSL_AIDX_ECC; break; } SSL_INSTANCE.setCertificate(ctx, certs[0], Arrays.copyOfRange(certs, 1, certs.length), sb.toString().getBytes(StandardCharsets.US_ASCII), idx); break; } } } }
https://github.com/wuhongzhi/wildfly-openssl/blob/master/java/src/main/java/org/wildfly/openssl/SSL.java
static final int SSL_AIDX_ECC = 3;
The text was updated successfully, but these errors were encountered:
Hi @wuhongzhi I would also like to see support for ECC. Could you turn this issue into a PR so that it can be merged?
Sorry, something went wrong.
I saw you had merged the c parts code, but java code yet, as my fork on 1.0.x, see my major modify on https://github.com/wuhongzhi/wildfly-openssl/blob/master/java/src/main/java/org/wildfly/openssl/OpenSSLContextSPI.java, as comment above.
No branches or pull requests
https://github.com/wuhongzhi/wildfly-openssl/blob/master/java/src/main/java/org/wildfly/openssl/OpenSSLContextSPI.java
https://github.com/wuhongzhi/wildfly-openssl/blob/master/java/src/main/java/org/wildfly/openssl/SSL.java
The text was updated successfully, but these errors were encountered: