MCPcopy Create free account
hub / github.com/questdb/questdb / start

Method start

core/src/test/java/io/questdb/test/tools/TlsProxy.java:77–97  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

75 }
76
77 public int start() {
78 return TestUtils.unchecked(() -> {
79 SSLContext sslContext = SSLContext.getInstance("TLS");
80 TrustManagerFactory tmf = TrustManagerFactory.getInstance(TrustManagerFactory.getDefaultAlgorithm());
81 tmf.init(KeyStore.getInstance(KeyStore.getDefaultType()));
82
83 KeyStore myKeyStore = KeyStore.getInstance(KeyStore.getDefaultType());
84 myKeyStore.load(TlsProxy.class.getResourceAsStream(keystore), keystorePassword);
85
86 KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm());
87 kmf.init(myKeyStore, keystorePassword);
88 sslContext.init(kmf.getKeyManagers(), tmf.getTrustManagers(), new SecureRandom());
89 SSLServerSocketFactory factory = sslContext.getServerSocketFactory();
90 serverSocket = factory.createServerSocket();
91 serverSocket.bind(null);
92
93 acceptorThread = new Thread(() -> acceptorLoop(serverSocket));
94 acceptorThread.start();
95 return serverSocket.getLocalPort();
96 });
97 }
98
99 public synchronized void stop() {
100 shutdownRequested = true;

Calls 6

uncheckedMethod · 0.95
acceptorLoopMethod · 0.95
getInstanceMethod · 0.65
initMethod · 0.65
loadMethod · 0.65
bindMethod · 0.45

Tested by

no test coverage detected