lorenzodonini / ocpp-go

Open Charge Point Protocol implementation in Go
MIT License
250 stars 109 forks source link

Bad Request response for https via curl request #247

Open aufalkhlq opened 6 months ago

aufalkhlq commented 6 months ago

Don't work https via curl.

upgrade:websocket: the client is not using the websocket protocol: 'upgrade' token not found in 'Connection' header

Go version : 1.21.3

lorenzodonini commented 3 months ago

More details are needed, such as the exact setup and parameters being passed to curl.

A simple websocket upgrade via curl example works just fine:

curl -v --include \
     --no-buffer \
     --header "Connection: Upgrade" \
     --header "Upgrade: websocket" \
     --header "Host: localhost:8887" \
     --header "Sec-WebSocket-Key: SGVsbG8sIHdvcmxkIQ==" \
     --header "Sec-WebSocket-Version: 13" \
     --header "Sec-WebSocket-Protocol: ocpp1.6" http://localhost:8887/client1

Adding the TLS should just be a matter of setting up the correct certificates.