1
0
Fork 0
mirror of https://github.com/puma/puma.git synced 2022-11-09 13:48:40 -05:00

Handle unauthenticated case

This commit is contained in:
David Arnold 2017-03-20 19:19:29 -04:00
parent 485bc9b81f
commit ad27aa82bb

View file

@ -336,7 +336,11 @@ public class MiniSSL extends RubyObject {
}
@JRubyMethod
public IRubyObject peercert() throws SSLPeerUnverifiedException, CertificateEncodingException {
return JavaEmbedUtils.javaToRuby(getRuntime(), engine.getSession().getPeerCertificates()[0].getEncoded());
public IRubyObject peercert() throws CertificateEncodingException {
try {
return JavaEmbedUtils.javaToRuby(getRuntime(), engine.getSession().getPeerCertificates()[0].getEncoded());
} catch (SSLPeerUnverifiedException ex) {
return getRuntime().getNil();
}
}
}