Skip to content

Instantly share code, notes, and snippets.

View chrisban's full-sized avatar

Christopher Ban chrisban

View GitHub Profile
@chrisban
chrisban / Spring mTLS web client
Last active February 7, 2023 00:35
Create a Spring WebClient that is initialized with a public CA Cert and a chain of client cert and secret key
@Slf4j
@Configuration
@RequiredArgsConstructor
public class MTLSWebClient {
private final MtlsWebClientProperties mtlsWebClientProperties;
@Bean
public WebClient createMtlsWebClient() {
HttpClient httpClient = HttpClient.create().secure(t -> t.sslContext(