Current location - Quotes Website - Personality signature - How does java HttpsURLConnection bypass the certificate, and what is the principle?
How does java HttpsURLConnection bypass the certificate, and what is the principle?
Recently, the project was accessed by connecting a url through HttpperlConnection. However, in the actual deployment environment, the web server used ssl, which could not be accessed directly through HttpperlConnection. Then, the access was realized by modifying the code, using HttpperlConnection and loading the certificate. But here's the problem. I should need the keystore file and password of the container every time. Later, I saw on the Internet that someone had code (auto-loading certificate) that could bypass the certificate or access it by using common-httpclient, but I knew nothing about this principle. Solve it! Supplementary question: If I use to load the keystore file, I need to know the keystore file set by the container every time I deploy the application. Through online code, I can access the url of https without paying attention to information such as certificates. Still confused. Thank you for your answers. I have a little idea in my mind, but I am still a little confused and still learning. When you say self-signed certificate, do you mean that the certificate used by the client is generated by itself during the communication with the server, and we use X509TrustManager to generate it in the code? & ltbr/>; & ltbr/>; & ltdiv class="quote_title "> Baigneaux wrote.