From d6e3bf6f4a5317a9fd1cac64917066dd353178ca Mon Sep 17 00:00:00 2001 From: etienne Date: Wed, 14 Feb 2024 21:16:49 +0100 Subject: [PATCH] Add SSL certificate bypass for socket connection --- frontend/src/contexts/SocketContext.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/frontend/src/contexts/SocketContext.tsx b/frontend/src/contexts/SocketContext.tsx index bb9d530..20b9be6 100644 --- a/frontend/src/contexts/SocketContext.tsx +++ b/frontend/src/contexts/SocketContext.tsx @@ -43,7 +43,9 @@ export default function SocketProvider({ return; } if (!socket) { - let socket = socketIO.connect(process.env.NEXT_PUBLIC_BASE_URL!); + let socket = socketIO.connect(process.env.NEXT_PUBLIC_BASE_URL!, { + rejectUnauthorized: false, // Ajoutez cette ligne si vous utilisez un certificat SSL auto-signé + }); socket.on("receive_message", (data: IMessage) => { setMessages((prev) => { const newMessages = { ...prev };