Skip to content

Commit d476597

Browse files
authored
Merge pull request #400 from kachayev/fix-ssl-context-depricated
Get rid of deprecated SslContext methods
2 parents 46e3e3f + f84f216 commit d476597

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/aleph/netty.clj

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -715,10 +715,12 @@
715715
"A self-signed SSL context for servers."
716716
[]
717717
(let [cert (SelfSignedCertificate.)]
718-
(SslContext/newServerContext (.certificate cert) (.privateKey cert))))
718+
(.build (SslContextBuilder/forServer (.certificate cert) (.privateKey cert)))))
719719

720720
(defn insecure-ssl-client-context []
721-
(SslContext/newClientContext InsecureTrustManagerFactory/INSTANCE))
721+
(-> (SslContextBuilder/forClient)
722+
(.trustManager InsecureTrustManagerFactory/INSTANCE)
723+
.build))
722724

723725
(defn- check-ssl-args
724726
[private-key certificate-chain]

0 commit comments

Comments
 (0)