We are using absinthe for websockets connections, it’s working fine in dev, but in our stage environment we get the following error: WebSocket connection to ‘wss://outsite.com/websocket/websocket?vsn=1.0.0’ failed.
To make it work on dev I had to change:
config :site, SiteWeb.Endpoint,
check_origin: false,
Now on stage, after that change, the error appears. This is the full config of stage:
use Mix.Config
api_url = System.get_env("API_URL") || raise "Missing API_URL."
config :site,
canonical_host: api_url
config :site, SiteWeb.Endpoint,
debug_errors: debug_errors,
server: true,
http: [
port: 80,
protocol_options: [max_keepalive: 5_000_000]
],
url: [host: api_url],
force_ssl: [hsts: true, rewrite_on: [:x_forwarded_proto]],
https: [
port: 443,
sni_fun: &SiteWeb.Endpoint.ssloptions/1,
otp_app: :site,
cipher_suite: :strong,
protocol_options: [max_keepalive: 5_000_000],
keyfile: ssl_path <> api_url <> "/privkey.pem",
cacertfile: ssl_path <> api_url <> "/chain.pem",
certfile: ssl_path <> api_url <> "/cert.pem",
versions: [:"tlsv1.3", :"tlsv1.2"],
honor_cipher_order: true,
ciphers: [
'TLS_AES_128_GCM_SHA256',
'TLS_AES_256_GCM_SHA384',
'TLS_CHACHA20_POLY1305_SHA256',
'ECDHE-ECDSA-AES128-GCM-SHA256',
'ECDHE-RSA-AES128-GCM-SHA256',
'ECDHE-ECDSA-AES256-GCM-SHA384',
'ECDHE-RSA-AES256-GCM-SHA384',
'ECDHE-ECDSA-CHACHA20-POLY1305',
'ECDHE-RSA-CHACHA20-POLY1305',
'DHE-RSA-AES128-GCM-SHA256',
'DHE-RSA-AES256-GCM-SHA384'
],
eccs: [:x25519, :secp256r1, :secp384r1],
secure_renegotiate: true,
reuse_sessions: true
],
check_origin: false,
cache_static_manifest: "priv/static/cache_manifest.json",
secret_key_base: secret_key_base
What could I be doing wrong?