java can't connect to https sites
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
ca-certificates-java (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
After installing 18.04 and default-jdk, which provides java/javac 1.10.1, Java applications are unable to connect to https sites. This can be reproduced with a simple Java program:
sam@sam-desktop:~$ cat <<EOF >HttpsTester.java
> import java.net.URL;
> import javax.net.
>
> public class HttpsTester {
> public static void main(String[] args) {
> try {
> HttpsURLConnection connection = (HttpsURLConnec
> System.
> System.
> } catch (Exception e) {
> System.
> }
> }
> }
> EOF
sam@sam-desktop:~$ javac HttpsTester.java
sam@sam-desktop:~$ java HttpsTester
java.lang.
This seems to be due to a misconfigured keystore in /etc/ssl/
sam@sam-desktop:~$ tar -zxf jre-10.
sam@sam-desktop:~$ java -Djavax.
Response code: 200
I'm not sure if this is somehow related to 1406483, but I've tried recreating my keystore (using 'sudo update-
My keystore is not empty, but contains a different set of keys to Oracle's one:
sam@sam-desktop:~$ keytool -list -keystore /etc/ssl/
Warning: use -cacerts option to access cacerts keystore
Your keystore contains 134 entries
sam@sam-desktop:~$ keytool -list -keystore jre-10.
Your keystore contains 104 entries
Running "java -Djavax. net.ssl. trustStorePassw ord=changeit HttpsTester" works, so I've marked this as a duplicate of bug #1743139.