My website deployed to Streamlit is displaying a blank page when visiting it from a custom domain See edit below for Render update.
What I did
- I wrote my site, linked my Github repo to Streamlit and deployed it, shortened Streamlit URL
- I then made two new CNAME records for my domain linking to the Streamlit site in Cloudflare dashboard where my domain was purchases and are managed. One CNAME record for the main URL, the other for “www”
- When loading the site from the Streamlit link it works fine
- When custom domain is tried the page is blank, only thing that loads is the Streamlit icon in the tab and Streamlit page title, nothing on the page itself.
Are there any addition files I need in my app’s root directory? Maybe some configuration step I missed?
My current folder structure
- .streamlit folder with config.toml file inside
I tried changing several settings on Cloudflare:
- Changed SSL to Full, when set to Flexible threw redirect error
- Turned off Always use HTTPS
- Turned off Automatic HTTPS Rewrites
- Tried replacing CNAME records with A records pointing to the site’s IP
EDIT I believe the issue has to do with SSL, I ran
openssl s_client -connect <my site URL>:443
and received the following output:
CONNECTED(00000005) 8679580928:error:1404B410:SSL routines:ST_CONNECT:sslv3 alert handshake failure:/AppleInternal/Library/BuildRoots/810eba08-405a-11ed-86e9-6af958a02716/Library/Caches/com.apple.xbs/Sources/libressl/libressl-3.3/ssl/tls13_lib.c:129:SSL alert number 40 --- no peer certificate available --- No client certificate CA names sent --- SSL handshake has read 7 bytes and written 287 bytes --- New, (NONE), Cipher is (NONE) Secure Renegotiation IS NOT supported Compression: NONE Expansion: NONE No ALPN negotiated SSL-Session: Protocol : TLSv1.3 Cipher : 0000 Session-ID: Session-ID-ctx: Master-Key: Start Time: 1677549075 Timeout : 7200 (sec) Verify return code: 0 (ok)
I believe this is saying there was an SSL handshake failure, SSL on Cloudlfare is set to full, how could I further troubleshoot this? Do I need to manually install an SSL Certificate? If so, how?
On my cloudlfare dashboard the SSL Certficate under Edge certificates is active and valid, I thought there was nothing else I needed to do but for some reason the SSL handshake is failing and I can’t figure out why.
EDIT2 I gave up on Streamlit, I decided to try deploying with Render and to my surprise it worked immediately, my custom domain and everything.
Is Streamlit just broken? I set the same settings with Render as Streamlit but Streamlit just refused to work with a custom domain. I’d prefer to know what’s going on exactly before giving up on the idea of deploying via Streamlit entirely.