1 / 1
Nov 2024

In my attempts to upgrade to 5.2.0 I have been trying to use the new API. This is a snippet of my current setup:

mongoClientSettingsBuilder.applyToSocketSettings(builder -> builder.applyToProxySettings(proxyBuilder -> proxyBuilder .host(inetSocketAddress.getHostName()) .port(inetSocketAddress.getPort()))); mongoClientSettingsBuilder.applyToSslSettings(builder -> { builder .context(context) .enabled(true) .invalidHostNameAllowed(connectionInfo.isSslInvalidHostNameAllowed()); });

These seem to work individually. I can connect through a Proxy, I can connect with SSL, but I cannot connect through a Proxy with SSL. It goes through the Proxy (I can see the traffic) but then the connection fails with:

|_/ Connection error (MongoSocketWriteException): Exception sending message |____/ SSL error: No valid certificate found |_______/ Certificate error: No valid certificate found

Clearly the SSL code works by itself as I can connect, so does the Proxy, just not with each other. What am I missing?

Thanks!

Bonus question: the Driver only seems to support Socks5 proxies, what is the solution for HTTP(S) proxies?