Hallo,
ich update einen DynDNS Dienst: ddnss.de
Dort wurde das https Zertifikat erneuert und nun bekomme ich:
Der Code an der Stelle:
Ich möchte aber kein Zertifikat händisch speichern ... ändert sich ja wieder mal und ich muss erneut alles händisch machen.
Kann meine Applikation nicht einfach "jedes" Zertifikat aktzeptieren?
Danke!
ich update einen DynDNS Dienst: ddnss.de
Dort wurde das https Zertifikat erneuert und nun bekomme ich:
Code:
javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at sun.security.ssl.Alerts.getSSLException(Unknown Source)
at sun.security.ssl.SSLSocketImpl.fatal(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.Handshaker.fatalSE(Unknown Source)
at sun.security.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at sun.security.ssl.ClientHandshaker.processMessage(Unknown Source)
at sun.security.ssl.Handshaker.processLoop(Unknown Source)
at sun.security.ssl.Handshaker.process_record(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.net.www.protocol.https.HttpsClient.afterConnect(Unknown Source)
at sun.net.www.protocol.https.AbstractDelegateHttpsURLConnection.connect(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream0(Unknown Source)
at sun.net.www.protocol.http.HttpURLConnection.getInputStream(Unknown Source)
at java.net.HttpURLConnection.getResponseCode(Unknown Source)
at sun.net.www.protocol.https.HttpsURLConnectionImpl.getResponseCode(Unknown Source)
at com.ddnss.DDNSS.run(DDNSS.java:38)
Der Code an der Stelle:
Java:
try {
String authStr = user + ":" + pass;
String authEncoded = Base64.encodeBytes(authStr.getBytes());
String url = "https://ddnss.de/nic/update?hostname=" + hostname;
URL obj = new URL(url);
HttpURLConnection con = (HttpURLConnection) obj.openConnection();
con.setConnectTimeout(5000);
con.setRequestMethod("GET");
con.setRequestProperty("User-Agent", USER_AGENT);
con.setRequestProperty("Authorization", "Basic " + authEncoded);
int responseCode = con.getResponseCode();
BufferedReader in = new BufferedReader(new InputStreamReader(
con.getInputStream()));
String inputLine;
StringBuffer response = new StringBuffer();
while ((inputLine = in.readLine()) != null) {
response.append(inputLine);
}
in.close();
con.disconnect();
Ich möchte aber kein Zertifikat händisch speichern ... ändert sich ja wieder mal und ich muss erneut alles händisch machen.
Kann meine Applikation nicht einfach "jedes" Zertifikat aktzeptieren?
Danke!