как узнать что настроен именно mtls
Я сконфигурировал RestTemplate для mtls. Как узнать что работает mtls, а не tls и в чем между ними различия при конфигурации?
public RestTemplate restTemplate(@Value("${client.ssl.trust-store}")
Resource trustStore,
@Value("${client.ssl.key-store}")
Resource keyStore,
@Value("${client.ssl.trust-store-password}")
String trustStorePassword,
@Value("${client.ssl.key-store-password}")
String keyStorePassword) throws Exception {
SSLContext sslcontext =
SSLContexts.custom().loadTrustMaterial(trustStore.getFile(), trustStorePassword.toCharArray())
.loadKeyMaterial(keyStore.getFile(), keyStorePassword.toCharArray(),
keyStorePassword.toCharArray()).setProtocol("TLSv1.2").build();
SSLConnectionSocketFactory sslConnectionSocketFactory =
new SSLConnectionSocketFactory(sslcontext, new NoopHostnameVerifier());
CloseableHttpClient httpClient = HttpClients.custom().setSSLSocketFactory(sslConnectionSocketFactory).build();
HttpComponentsClientHttpRequestFactory httpComponentsClientHttpRequestFactory = new HttpComponentsClientHttpRequestFactory(httpClient);
return new RestTemplate(httpComponentsClientHttpRequestFactory);
}
Вот такой лог ссл я получаю на стороне клиента и сервера :
client
Produced ClientHello handshake message
Consuming ServerHello handshake message
Consuming ChangeCipherSpec message
Consuming EncryptedExtensions handshake message
Consuming CertificateRequest handshake message
Consuming server Certificate handshake message
Consuming CertificateVerify handshake message
Consuming server Finished handshake message
Produced client Certificate message
Produced client CertificateVerify handshake message
Produced client Finished handshake message
Consuming NewSessionTicket message
server
Consuming ClientHello handshake message
Produced ServerHello handshake message
Produced EncryptedExtensions message
Produced CertificateRequest message
Produced server Certificate message
Produced server CertificateVerify handshake message
Produced server Finished handshake message
Consuming ChangeCipherSpec message
Consuming client Certificate handshake message
Consuming CertificateVerify handshake message
Consuming client Finished handshake message
Produced NewSessionTicket stateless post-handshake message
Это похоже на mtls?