Download Jar. Libraryless. Click here for Pure Java version (4950L/36K).
!7 import javax.net.ssl.*; p { char[] passphrase = trim(loadSecretTextFileMandatory(#1013896, "keystore-pass")).toCharArray(); KeyStore trustKeyStore = keyStoreFromFile(javaxSecretDir("keystore.p12"), passphrase); KeyManager keyManager_botCompany = keyManagerFromKeyStore(javaxSecretDir("keystore.p12"), passphrase); KeyManager keyManager_agiBlue = keyManagerFromKeyStore(javaxSecretDir("agi.blue/keystore.p12"), passphrase); SNIKeyManager wrappedKeyManager = new(litorderedmap( "botcompany.de", pair(keyManager_botCompany, "botcompany"), "agi.blue", pair(keyManager_agiBlue, "agi.blue")); wrappedKeyManager.verbose = true; TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); trustManagerFactory.init(trustKeyStore); SSLContext ctx = SSLContext.getInstance("TLS"); ctx.init(new KeyManager[] {wrappedKeyManager}, trustManagerFactory.getTrustManagers(), null); serveHttps(1443, ctx.getServerSocketFactory()); } html { ret "It works!"; }
Began life as a copy of #1024323
download show line numbers debug dex old transpilations
Travelled to 6 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt
No comments. add comment
Snippet ID: | #1024325 |
Snippet name: | Serve HTTPS with SNI Spike 2 [WORKS!] |
Eternal ID of this version: | #1024325/8 |
Text MD5: | 6b63b3481c85356e882ff630742f6d36 |
Transpilation MD5: | 144ba1b78e619165c2f18c99425c3f17 |
Author: | stefan |
Category: | javax / https |
Type: | JavaX source code (desktop) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2019-08-02 15:18:51 |
Source code size: | 1073 bytes / 28 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 318 / 985 |
Version history: | 7 change(s) |
Referenced in: | [show references] |