Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you want to do it the right way, and/or you need to deal with only one site, then you basically need to grab the SSL certificate of the website in question and import it in your Java key store. This will result in a JKS file which you in turn set as SSL trust store before using Jsoup (or <code>java.net.URLConnection</code>). </p> <p>You can grab the certificate from your webbrowser's store. Let's assume that you're using Firefox.</p> <ol> <li>Go to the website in question using Firefox, which is in your case <a href="https://web2.uconn.edu/driver/old/timepoints.php?stopid=10" rel="noreferrer">https://web2.uconn.edu/driver/old/timepoints.php?stopid=10</a></li> <li>Left in the address bar you'll see "uconn.edu" in blue (this indicates a valid SSL certificate)</li> <li>Click on it for details and then click on the <em>More information</em> button.</li> <li>In the security dialogue which appears, click the <em>View Certificate</em> button.</li> <li>In the certificate panel which appears, go to the <em>Details</em> tab.</li> <li>Click the deepest item of the certificate hierarchy, which is in this case "web2.uconn.edu" and finally click the <em>Export</em> button.</li> </ol> <p>Now you've a <code>web2.uconn.edu.crt</code> file.</p> <p>Next, open the command prompt and import it in the Java key store using the <code>keytool</code> command (it's part of the JRE):</p> <pre><code>keytool -import -v -file /path/to/web2.uconn.edu.crt -keystore /path/to/web2.uconn.edu.jks -storepass drowssap </code></pre> <p>The <code>-file</code> must point to the location of the <code>.crt</code> file which you just downloaded. The <code>-keystore</code> must point to the location of the generated <code>.jks</code> file (which you in turn want to set as SSL trust store). The <code>-storepass</code> is required, you can just enter whatever password you want as long as it's at least 6 characters.</p> <p>Now, you've a <code>web2.uconn.edu.jks</code> file. You can finally set it as SSL trust store before connecting as follows:</p> <pre><code>System.setProperty("javax.net.ssl.trustStore", "/path/to/web2.uconn.edu.jks"); Document document = Jsoup.connect("https://web2.uconn.edu/driver/old/timepoints.php?stopid=10").get(); // ... </code></pre> <hr> <p>As a completely different alternative, particularly when you need to deal with multiple sites (i.e. you're creating a world wide web crawler), then you can also instruct Jsoup (basically, <code>java.net.URLConnection</code>) to blindly trust all SSL certificates. See also section "Dealing with untrusted or misconfigured HTTPS sites" at the very bottom of this answer: <a href="https://stackoverflow.com/questions/2793150/using-java-net-urlconnection-to-fire-and-handle-http-requests/2793153#2793153">Using java.net.URLConnection to fire and handle HTTP requests</a></p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload