Are HTTPS URLs encrypted?

Yes, the SSL connection is between the TCP layer and the HTTP layer. The client and server first establish a secure encrypted TCP connection (via the SSL/TLS protocol) and then the client will send the HTTP request (GET, POST, DELETE…) over that encrypted TCP connection.

file_get_contents(): SSL operation failed with code 1, Failed to enable crypto

This was an enormously helpful link to find: http://php.net/manual/en/migration56.openssl.php An official document describing the changes made to open ssl in PHP 5.6 From here I learned of one more parameter I should have set to false: “verify_peer_name”=>false Note: This has very significant security implications. Disabling verification potentially permits a MITM attacker to use an invalid … Read more

Trust Anchor not found for Android SSL Connection

Contrary to the accepted answer you do not need a custom trust manager, you need to fix your server configuration! I hit the same problem while connecting to an Apache server with an incorrectly installed dynadot/alphassl certificate. I’m connecting using HttpsUrlConnection (Java/Android), which was throwing – javax.net.ssl.SSLHandshakeException: java.security.cert.CertPathValidatorException: Trust anchor for certification path not found. … Read more

Is a HTTPS query string secure?

Yes, it is. But using GET for sensitive data is a bad idea for several reasons: Mostly HTTP referrer leakage (an external image in the target page might leak the password[1]) Password will be stored in server logs (which is obviously bad) History caches in browsers Therefore, even though Querystring is secured it’s not recommended … Read more

Java: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

The problem appears when your server has self signed certificate. To workaround it you can add this certificate to the list of trusted certificates of your JVM. In this article author describes how to fetch the certificate from your browser and add it to cacerts file of your JVM. You can either edit JAVA_HOME/jre/lib/security/cacerts file … Read more

Default SecurityProtocol in .NET 4.5

Some of the those leaving comments on other answers have noted that setting System.Net.ServicePointManager.SecurityProtocol to specific values means that your app won’t be able to take advantage of future TLS versions that may become the default values in future updates to .NET. Instead of specifying a fixed list of protocols, do the following: For .NET … Read more

Python Requests throwing SSLError

The problem you are having is caused by an untrusted SSL certificate. Like @dirk mentioned in a previous comment, the quickest fix is setting verify=False: requests.get(‘https://example.com’, verify=False) Please note that this will cause the certificate not to be verified. This will expose your application to security risks, such as man-in-the-middle attacks. Of course, apply judgment. … Read more

How can I use different certificates on specific connections?

Create an SSLSocket factory yourself, and set it on the HttpsURLConnection before connecting. … HttpsURLConnection conn = (HttpsURLConnection)url.openConnection(); conn.setSSLSocketFactory(sslFactory); conn.setMethod(“POST”); … You’ll want to create one SSLSocketFactory and keep it around. Here’s a sketch of how to initialize it: /* Load the keyStore that includes self-signed cert as a “trusted” entry. */ KeyStore keyStore = … Read more

Accept server’s self-signed ssl certificate in Java client

You have basically two options here: add the self-signed certificate to your JVM truststore or configure your client to Option 1 Export the certificate from your browser and import it in your JVM truststore (to establish a chain of trust): <JAVA_HOME>\bin\keytool -import -v -trustcacerts -alias server-alias -file server.cer -keystore cacerts.jks -keypass changeit -storepass changeit Option … Read more