Libraryless. Click here for Pure Java version (2858L/19K).
1 | import javax.net.*; |
2 | import javax.net.ssl.*; |
3 | |
4 | static SNIKeyManager serverSocketFactory_botCompanyPlusAgiBlue_keyManager; |
5 | |
6 | static SSLServerSocketFactory serverSocketFactory_botCompanyPlusAgiBlue() ctex { |
7 | char[] passphrase = trim(loadSecretTextFileMandatory(#1013896, "keystore-pass")).toCharArray(); |
8 | |
9 | KeyStore trustKeyStore = keyStoreFromFile(javaxSecretDir("keystore.p12"), passphrase); |
10 | KeyManager keyManager_botCompany = keyManagerFromKeyStore(javaxSecretDir("keystore.p12"), passphrase); |
11 | KeyManager keyManager_agiBlue = keyManagerFromKeyStore(javaxSecretDir("agi.blue/keystore.p12"), passphrase); |
12 | KeyManager keyManager_abotsSpace = keyManagerFromKeyStore(javaxSecretDir("abots.space/keystore.p12"), passphrase); |
13 | KeyManager keyManager_stefansOSSite = keyManagerFromKeyStore(javaxSecretDir("stefans-os.site/keystore.p12"), passphrase); |
14 | |
15 | SNIKeyManager wrappedKeyManager = new(litorderedmap( |
16 | "botcompany.de", pair(keyManager_botCompany, "botcompany.de"), |
17 | "agi.blue", pair(keyManager_agiBlue, "agi.blue"), |
18 | "abots.space", pair(keyManager_abotsSpace, "abots.space"), |
19 | "stefans-os.site", pair(keyManager_stefansOSSite, "stefans-os.site"), |
20 | "zttnn.me", pair(keyManagerFromKeyStore(javaxSecretDir("zttnn.me/keystore.p12"), passphrase), "zttnn.me"))); |
21 | serverSocketFactory_botCompanyPlusAgiBlue_keyManager = wrappedKeyManager; |
22 | |
23 | //wrappedKeyManager.verbose = true; |
24 | |
25 | TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm()); |
26 | trustManagerFactory.init(trustKeyStore); |
27 | |
28 | SSLContext ctx = SSLContext.getInstance("TLS"); |
29 | ctx.init(new KeyManager[] {wrappedKeyManager}, trustManagerFactory.getTrustManagers(), null); |
30 | |
31 | ret ctx.getServerSocketFactory(); |
32 | } |
Began life as a copy of #1024328
download show line numbers debug dex old transpilations
Travelled to 7 computer(s): bhatertpkbcr, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt, xrpafgyirdlv
No comments. add comment
Snippet ID: | #1028044 |
Snippet name: | serverSocketFactory_botCompanyPlusAgiBlue backup |
Eternal ID of this version: | #1028044/1 |
Text MD5: | 1a4c8af167527224dee419304b865394 |
Transpilation MD5: | f93ef6c92e0e96bd20da32e5a3e98aec |
Author: | stefan |
Category: | javax / https |
Type: | JavaX fragment (include) |
Public (visible to everyone): | Yes |
Archived (hidden from active list): | No |
Created/modified: | 2020-05-08 10:24:09 |
Source code size: | 1775 bytes / 32 lines |
Pitched / IR pitched: | No / No |
Views / Downloads: | 192 / 274 |
Referenced in: | [show references] |