Skip to content

Commit 5cd5527

Browse files
authored
[fix] replace deprecated getPeerCertificateChain (#231)
Co-authored-by: Pavel Rosický <[email protected]>
1 parent 6499245 commit 5cd5527

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1043,15 +1043,15 @@ public IRubyObject peer_cert_chain(final ThreadContext context) {
10431043
if ( engine == null ) return runtime.getNil();
10441044

10451045
try {
1046-
javax.security.cert.Certificate[] certs = engine.getSession().getPeerCertificateChain();
1046+
Certificate[] certs = engine.getSession().getPeerCertificates();
10471047
IRubyObject[] cert_chain = new IRubyObject[ certs.length ];
10481048
for ( int i = 0; i < certs.length; i++ ) {
10491049
cert_chain[i] = X509Cert.wrap(context, certs[i]);
10501050
}
10511051
return runtime.newArrayNoCopy(cert_chain);
10521052
}
1053-
catch (javax.security.cert.CertificateEncodingException e) {
1054-
throw X509Cert.newCertificateError(getRuntime(), e);
1053+
catch (CertificateEncodingException e) {
1054+
throw X509Cert.newCertificateError(runtime, e);
10551055
}
10561056
catch (SSLPeerUnverifiedException e) {
10571057
if (runtime.isVerbose() || OpenSSL.isDebug(runtime)) {

0 commit comments

Comments
 (0)