File tree Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Expand file tree Collapse file tree 5 files changed +24
-13
lines changed Original file line number Diff line number Diff line change 108
108
(s/put! response-stream ex)
109
109
110
110
; ; when SSL handshake failed
111
- (http /ssl-handshake-error? ex)
111
+ (netty /ssl-handshake-error? ex)
112
112
(let [^Throwable handshake-error (.getCause ^Throwable ex)]
113
113
(s/put! response-stream handshake-error))
114
114
Original file line number Diff line number Diff line change 23
23
ByteBuf]
24
24
[java.nio
25
25
ByteBuffer]
26
- [io.netty.handler.codec DecoderException]
27
26
[io.netty.handler.codec.http
28
27
DefaultHttpRequest DefaultLastHttpContent
29
28
DefaultHttpResponse DefaultFullHttpRequest
62
61
ConcurrentLinkedQueue
63
62
TimeUnit]
64
63
[java.util.concurrent.atomic
65
- AtomicBoolean]
66
- [javax.net.ssl SSLHandshakeException]))
64
+ AtomicBoolean]))
67
65
68
66
(def non-standard-keys
69
67
(let [ks [" Content-MD5"
684
682
(when (and (identical? ::ping-timeout v)
685
683
(.isOpen ^Channel (.channel ctx)))
686
684
(netty/close ctx))))))))
687
-
688
- (defn ssl-handshake-error? [^Throwable ex]
689
- (and (instance? DecoderException ex)
690
- (instance? SSLHandshakeException (.getCause ex))))
Original file line number Diff line number Diff line change 211
211
(defn exception-handler [ctx ex]
212
212
(cond
213
213
; ; do not need to log an entire stack trace when SSL handshake failed
214
- (http /ssl-handshake-error? ex)
214
+ (netty /ssl-handshake-error? ex)
215
215
(log/warn " SSL handshake failure:"
216
216
(.getMessage ^Throwable (.getCause ^Throwable ex)))
217
217
Original file line number Diff line number Diff line change 37
37
SslContext
38
38
SslContextBuilder
39
39
SslHandler]
40
+ [io.netty.handler.codec DecoderException]
40
41
[io.netty.handler.ssl.util
41
42
SelfSignedCertificate InsecureTrustManagerFactory]
42
43
[io.netty.resolver
76
77
LoggingHandler
77
78
LogLevel]
78
79
[java.security.cert X509Certificate]
79
- [java.security PrivateKey]))
80
+ [java.security PrivateKey]
81
+ [javax.net.ssl SSLHandshakeException]))
80
82
81
83
; ;;
82
84
789
791
^SslHandler (.get SslHandler)
790
792
.engine
791
793
.getSession))
794
+
795
+ (defn ssl-handshake-error? [^Throwable ex]
796
+ (and (instance? DecoderException ex)
797
+ (instance? SSLHandshakeException (.getCause ex))))
798
+
792
799
; ;;
793
800
794
801
(defprotocol AlephServer
Original file line number Diff line number Diff line change 30
30
31
31
:exception-caught
32
32
([_ ctx ex]
33
- (when-not (instance? IOException ex)
34
- (log/warn ex " error in TCP server" )))
33
+ (cond
34
+ ; ; do not need to log an entire stack trace when SSL handshake failed
35
+ (netty/ssl-handshake-error? ex)
36
+ (log/warn " SSL handshake failure:"
37
+ (.getMessage ^Throwable (.getCause ^Throwable ex)))
38
+
39
+ (not (instance? IOException ex))
40
+ (log/warn ex " error in TCP server" )))
35
41
36
42
:channel-inactive
37
43
([_ ctx]
98
104
:exception-caught
99
105
([_ ctx ex]
100
106
(when-not (d/error! d ex)
101
- (log/warn ex " error in TCP client" )))
107
+ (if (netty/ssl-handshake-error? ex)
108
+ ; ; do not need to log an entire stack trace when SSL handshake failed
109
+ (log/warn " SSL handshake failure:"
110
+ (.getMessage ^Throwable (.getCause ^Throwable ex)))
111
+ (log/warn ex " error in TCP client" ))))
102
112
103
113
:channel-inactive
104
114
([_ ctx]
You can’t perform that action at this time.
0 commit comments