quiet-painting-32952
05/23/2024, 6:27 PMory tunnel --dev --project <projectId> https://<domain> --cookie-domain <domain>
When I try to access the whoami endpoint via that https domain I get the following error:
Error: write EPROTO 4839707416:error:100000f7:SSL routines:OPENSSL_internal:WRONG_VERSION_NUMBER:../../../../src/third_party/boringssl/src/ssl/tls_record.cc:242:
Am I missing a configuraiton? I tries to set a config file like this to point to the ssl keys but no luck:
{
"serve": {
"public": {
"tls": {
"cert": {
"path": "/<path>/cert.pem"
},
"key": {
"path": "/<path>/privkey.pem"
}
}
}
}
}
chilly-king-10285
05/23/2024, 6:27 PMchilly-king-10285
05/23/2024, 6:27 PMbash openssl genrsa -out key.pem 4096 openssl req -new -x509 -sha256 -key key.pem -out cert.crt -days 365
Then, you can either base64 encode the certificates and keys and pass them as environment variables: bash SERVE_PUBLIC_TLS_CERT_BASE64=$(base64 -i cert.crt) SERVE_PUBLIC_TLS_KEY_BASE64=$(base64 -i key.pem) SERVE_ADMIN_TLS_CERT_BASE64=$(base64 -i cert.crt) SERVE_ADMIN_TLS_KEY_BASE64=$(base64 -i key.pem)
Or, you can directly provide the paths to the certificates and keys: bash SERVE_PUBLIC_TLS_KEY_PATH=/path/to/key.pem SERVE_PUBLIC_TLS_CERT_PATH=/path/to/cert.crt SERVE_ADMIN_TLS_KEY_PATH=/path/to/key.pem SERVE_ADMIN_TLS_CERT_PATH=/path/to/cert.crt
If you're running Docker locally, you can pass these as environment variables: bash docker run ... \ -e SERVE_PUBLIC_TLS_CERT_BASE64="$SERVE_PUBLIC_TLS_CERT_BASE64" \ -e SERVE_PUBLIC_TLS_KEY_BASE64="$SERVE_PUBLIC_TLS_KEY_BASE64" \ -e SERVE_ADMIN_TLS_CERT_BASE64="$SERVE_ADMIN_TLS_CERT_BASE64" \ -e SERVE_ADMIN_TLS_KEY_BASE64="$SERVE_ADMIN_TLS_KEY_BASE64" \ ...
Or, you can mount the files using --mount
and linking to the files. Please note that the error you're seeing (WRONG_VERSION_NUMBER
) typically indicates a protocol mismatch. It's possible that the client is trying to connect using a different version of SSL/TLS than the server is configured to accept. For more details, please refer to the [Ory Kratos HTTPS (TLS) setup guide](https://www.ory.sh/docs/kratos/guides/https-tls).quiet-painting-32952
05/24/2024, 8:06 AMory proxy
and I would like it to be serve via https, how do I do thatchilly-king-10285
05/24/2024, 8:06 AMchilly-king-10285
05/24/2024, 8:07 AMory proxy
command with HTTPS. The ory proxy
command is used to expose your application through the Ory Proxy, and it doesn't have a built-in option for HTTPS. However, you can secure your application with HTTPS at the server level. This involves obtaining an SSL certificate for your domain and configuring your server to use this certificate for HTTPS connections. The exact steps for this process depend on your server software (e.g., Nginx, Apache). Here are some general steps: 1. Obtain an SSL certificate for your domain. You can get a free certificate from Let's Encrypt. 2. Install the SSL certificate on your server. The process for this varies depending on your server software. 3. Configure your server to use the SSL certificate for HTTPS connections. This usually involves editing your server's configuration file to specify the paths to the certificate and private key files. 4. Update your server's firewall rules to allow HTTPS traffic on port 443. 5. Restart your server to apply the changes. After setting up HTTPS at the server level, you can continue to use the ory proxy
command as before. The Ory Proxy will now be accessible via HTTPS. Please note that this is a general guide and the exact steps may vary depending on your specific setup and server software. For more detailed instructions, please refer to your server software's documentation.