diff --git a/Sources/WebSocketKit/WebSocket.swift b/Sources/WebSocketKit/WebSocket.swift index 3e6f679c..6ab6b6fd 100644 --- a/Sources/WebSocketKit/WebSocket.swift +++ b/Sources/WebSocketKit/WebSocket.swift @@ -186,7 +186,9 @@ public final class WebSocket { func makeMaskKey() -> WebSocketMaskingKey? { switch type { case .client: - return WebSocketMaskingKey.random() + /// See https://github.com/apple/swift/issues/66099 + var generator = SystemRandomNumberGenerator() + return WebSocketMaskingKey.random(using: &generator) case .server: return nil }