Commit 6a81093d authored by Jannik Hoelling's avatar Jannik Hoelling
Browse files

java improve exitcodes

parent fa5ebfac
......@@ -88,13 +88,20 @@ public class Client {
System.out.println(e);
sslSocket.close();
System.exit(1);
} catch (javax.net.ssl.SSLProtocolException e) {
System.out.println(e);
sslSocket.close();
if (e.getMessage().startsWith("Invalid application_layer_protocol_negotiation")) {
System.exit(120);
}
System.exit(1);
}
// Hostname verification
String peerCNname = getCommonName((X509Certificate) sslSocket.getSession().getPeerCertificates()[0]);
if (!peerCNname.equals(servername)) {
System.out.println("Hostname Verification failed: " + peerCNname);
System.exit(1);
System.exit(112);
}
System.out.println("Hostname Verification succeded: " + peerCNname);
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment