private HttpURLConnection openConnection(final String uri) throws IOException, MalformedURLException {
        if (tlsEnabled) {
            final HttpsURLConnection connection = (HttpsURLConnection) new URL(uri).openConnection();
            if (allowInsecure) {
                // Create a trust manager that does not validate certificate chains
                // and trust all certificates
                final TrustManager[] trustAllCerts = new TrustManager[] {
                    new X509ExtendedTrustManager() {
                        @Override
                        public X509Certificate[] getAcceptedIssuers() {
                            return new X509Certificate[0];
                        }

                        @Override
                        public void checkClientTrusted(final X509Certificate[] certs, final String authType) {}

                        @Override
                        public void checkServerTrusted(final X509Certificate[] certs, final String authType) {}

                        @Override
                        public void checkClientTrusted(X509Certificate[] chain, String authType, Socket socket) {}

                        @Override
                        public void checkServerTrusted(X509Certificate[] chain, String authType, Socket socket) {}

                        @Override
                        public void checkClientTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {}

                        @Override
                        public void checkServerTrusted(X509Certificate[] chain, String authType, SSLEngine engine) {}
                    },
                };

                try {
                    // Create custom SSL context and set the "trust all certificates" trust manager
                    final SSLContext sc = SSLContext.getInstance("SSL");
                    sc.init(new KeyManager[0], trustAllCerts, new SecureRandom());
                    connection.setSSLSocketFactory(sc.getSocketFactory());
                } catch (final NoSuchAlgorithmException | KeyManagementException ex) {
                    throw new IOException("Unable to create custom SSL factory instance", ex);
                }
            }

            return connection;
        } else {
            return (HttpURLConnection) new URL(uri).openConnection();
        }
    }
Waits for the response to pass the given predicate
@param responsePredicate The predicate to test the response against
@return this
core/src/main/java/org/testcontainers/containers/wait/strategy/HttpWaitStrategy.java