[GH-ISSUE #1257] [BUG]: Websocket not being upgraded with manual HTTP certificate set #784

Closed
opened 2026-02-22 18:21:20 -05:00 by yindo · 9 comments
Owner

Originally created by @man2004 on GitHub (May 1, 2024).
Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1257

How are you running AnythingLLM?

Docker (remote machine)

What happened?

When I typed @agent to launch it, it showed following and the agent session ended immediately:

Agent @agent invoked.
Swapping over to agent chat. Type /exit to exit agent execution loop early.

Agent session complete.

I am using docker image I pulled today.

Are there known steps to reproduce?

No response

Originally created by @man2004 on GitHub (May 1, 2024). Original GitHub issue: https://github.com/Mintplex-Labs/anything-llm/issues/1257 ### How are you running AnythingLLM? Docker (remote machine) ### What happened? When I typed @agent to launch it, it showed following and the agent session ended immediately: ``` Agent @agent invoked. Swapping over to agent chat. Type /exit to exit agent execution loop early. Agent session complete. ``` I am using docker image I pulled today. ### Are there known steps to reproduce? _No response_
yindo added the Dockercore-team-onlyinvestigating labels 2026-02-22 18:21:20 -05:00
yindo closed this issue 2026-02-22 18:21:20 -05:00
Author
Owner

@man2004 commented on GitHub (May 1, 2024):

I have just found it might be because of SSL. With same docker image, after I enabled SSL and accessed with https://domain_name, then agent ended immediately. If I disabled SSL and accessed with http://ip_address, then agent worked.

@man2004 commented on GitHub (May 1, 2024): I have just found it might be because of SSL. With same docker image, after I enabled SSL and accessed with https://domain_name, then agent ended immediately. If I disabled SSL and accessed with http://ip_address, then agent worked.
Author
Owner
@timothycarambat commented on GitHub (May 1, 2024): Relevant line where if on https, we assume the backend has SSL as well so we upgrade WS to WSS https://github.com/Mintplex-Labs/anything-llm/blob/9feaad79cc69c826001b36d0e129da403a695d23/frontend/src/utils/chat/agent.js#L18 If using nginx as a proxy https://github.com/Mintplex-Labs/anything-llm/blob/9feaad79cc69c826001b36d0e129da403a695d23/cloud-deployments/aws/cloudformation/aws_https_instructions.md?plain=1#L68-L73
Author
Owner

@man2004 commented on GitHub (May 15, 2024):

Thanks. I originally used the SSL feature in AnythingLLM and did not use nginx as proxy. After changing to use nginx as proxy, problem solved.

@man2004 commented on GitHub (May 15, 2024): Thanks. I originally used the SSL feature in AnythingLLM and did not use nginx as proxy. After changing to use nginx as proxy, problem solved.
Author
Owner

@Anto79-ops commented on GitHub (May 16, 2024):

I'm also experiecing the same because I have AnythingLLM using https: to server with these lines in my .env file

ENABLE_HTTPS='true'
HTTPS_CERT_PATH='path to/server.crt'
HTTPS_KEY_PATH='path to /docker$

I'd rather not remove the https encryption. Is there a workaround? thanks

@Anto79-ops commented on GitHub (May 16, 2024): I'm also experiecing the same because I have AnythingLLM using https: to server with these lines in my `.env` file ``` ENABLE_HTTPS='true' HTTPS_CERT_PATH='path to/server.crt' HTTPS_KEY_PATH='path to /docker$ ``` I'd rather not remove the `https` encryption. Is there a workaround? thanks
Author
Owner

@timothycarambat commented on GitHub (May 16, 2024):

When you have the network inspector open, can you tell me what happens to the socket and what URL it tries to reach?
If the frontend is running https it should upgrade the socket to wss automatically

@timothycarambat commented on GitHub (May 16, 2024): When you have the network inspector open, can you tell me what happens to the socket and what URL it tries to reach? If the frontend is running https it should upgrade the socket to `wss` automatically
Author
Owner

@Anto79-ops commented on GitHub (May 16, 2024):

sure, I'd be happy to share that. When expanding the netwrok information in Chrome, what would you like to me expand here?

image

also, here's the error from Chrome, it does open wss

image

@Anto79-ops commented on GitHub (May 16, 2024): sure, I'd be happy to share that. When expanding the netwrok information in Chrome, what would you like to me expand here? ![image](https://github.com/Mintplex-Labs/anything-llm/assets/79593761/e33744bd-13dd-4dfb-8bca-a5b8d7655605) also, here's the error from Chrome, it does open `wss` ![image](https://github.com/Mintplex-Labs/anything-llm/assets/79593761/878872ec-b267-4097-be0d-03506a8f6638)
Author
Owner

@timothycarambat commented on GitHub (May 16, 2024):

Okay, so it looks like it does upgrade the Websocket connection. What do the docker logs say on the backend when the agent is invoked - if anything? Im thinking maybe the websocket does not inherit the SSL cert like the whole express server does.

@timothycarambat commented on GitHub (May 16, 2024): Okay, so it looks like it does upgrade the Websocket connection. What do the docker logs say on the backend when the agent is invoked - if anything? Im thinking maybe the websocket does not inherit the SSL cert like the whole express server does.
Author
Owner

@Anto79-ops commented on GitHub (May 16, 2024):

That is correct. The docker logs do not say anything while all this is happening.

@Anto79-ops commented on GitHub (May 16, 2024): That is correct. The docker logs do not say anything while all this is happening.
Author
Owner

@timothycarambat commented on GitHub (May 17, 2024):

Resolved via https://github.com/Mintplex-Labs/anything-llm/pull/1429

@timothycarambat commented on GitHub (May 17, 2024): Resolved via https://github.com/Mintplex-Labs/anything-llm/pull/1429
yindo changed title from [BUG]: Websocket not being upgraded with manual HTTP certificate set to [GH-ISSUE #1257] [BUG]: Websocket not being upgraded with manual HTTP certificate set 2026-06-05 14:37:11 -04:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: Mintplex-Labs/anything-llm#784