Skip to content

Commit 6a4ee35

Browse files
committed
Don't print a warning for missing client certs
When you run Ruby with warnings enabled and your (HTTPS) server does not verify clients you don't expect to see a warning about clients not being verified. For example, WEBrick's default configuration does not verify client certificates (https://github.com/jruby/jruby/blob/b610805cd55ef5d56d8e431918753fc92fad5ef5/lib/ruby/stdlib/webrick/ssl.rb#L74), but when running an HTTP server in JRuby it prints "warning: javax.net.ssl.SSLPeerUnverifiedException: peer not authenticated" for every request. This does not happen in MRI.
1 parent 2678bab commit 6a4ee35

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/org/jruby/ext/openssl/SSLSocket.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,7 @@ public IRubyObject peer_cert() {
958958
throw X509Cert.newCertificateError(runtime, e);
959959
}
960960
catch (SSLPeerUnverifiedException e) {
961-
if (runtime.isVerbose() || OpenSSL.isDebug(runtime)) {
961+
if (OpenSSL.isDebug(runtime)) {
962962
runtime.getWarnings().warning(String.format("%s: %s", e.getClass().getName(), e.getMessage()));
963963
}
964964
}

0 commit comments

Comments
 (0)