@@ -156,7 +156,7 @@ extension SSLConnection {
156156 inputBytes. writeBytes ( `in`)
157157
158158 let result = customKey. sign ( channel: channel, algorithm: wrappedAlgorithm, data: inputBytes)
159- result. whenComplete { signingResult in
159+ result. hop ( to : channel . eventLoop ) . assumeIsolated ( ) . whenComplete { signingResult in
160160 self . storeCustomPrivateKeyResult ( signingResult, channel: channel)
161161 }
162162
@@ -178,7 +178,7 @@ extension SSLConnection {
178178 inputBytes. writeBytes ( `in`)
179179
180180 let result = customKey. decrypt ( channel: channel, data: inputBytes)
181- result. whenComplete { decryptionResult in
181+ result. hop ( to : channel . eventLoop ) . assumeIsolated ( ) . whenComplete { decryptionResult in
182182 self . storeCustomPrivateKeyResult ( decryptionResult, channel: channel)
183183 }
184184
@@ -207,7 +207,7 @@ extension SSLConnection {
207207 // When we complete here we need to set our result state, and then ask to respin the handshake.
208208 // If we can't respin the handshake because we've dropped the parent handler, that's fine, no harm no foul.
209209 // For that reason, we tolerate both the verify manager and the parent handler being nil.
210- channel. eventLoop. execute {
210+ channel. eventLoop. assumeIsolated ( ) . execute {
211211 precondition ( self . customPrivateKeyResult == nil )
212212 self . customPrivateKeyResult = result
213213 self . parentHandler? . resumeHandshake ( )
0 commit comments