Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

st.runtime.get_instance()._session_mgr.list_active_sessions()[0].client.request.protocol is http on https pages. #8600

Open
3 of 4 tasks
wyattscarpenter opened this issue May 3, 2024 · 5 comments
Labels
feature:community-cloud Related to Streamlit Community Cloud priority:P4 type:bug Something isn't working

Comments

@wyattscarpenter
Copy link

Checklist

  • I have searched the existing issues for similar issues.
  • I added a very descriptive title to this issue.
  • I have provided sufficient information below to help reproduce this issue.

Summary

st.runtime.get_instance()._session_mgr.list_active_sessions()[0].client.request.protocol is http on https pages.

Reproducible Code Example

import streamlit as st

st.write( st.runtime.get_instance()._session_mgr.list_active_sessions()[0].client.request.protocol )

# When run from an https source, like *.streamlit.app, this will still list http.

Steps To Reproduce

No response

Expected Behavior

Should be https

Current Behavior

Is http

Is this a regression?

  • Yes, this used to work in a previous version.

Debug info

  • Streamlit version: Streamlit, version 1.33.0
    And also whatever streamlit community cloud uses.

Additional Information

No response

@wyattscarpenter wyattscarpenter added status:needs-triage Has not been triaged by the Streamlit team type:bug Something isn't working labels May 3, 2024
Copy link

github-actions bot commented May 3, 2024

If this issue affects you, please react with a 👍 (thumbs up emoji) to the initial post.

Your feedback helps us prioritize which bugs to investigate and address first.

Visits

@kajarenc
Copy link
Collaborator

kajarenc commented May 6, 2024

Hey @wyattscarpenter and thank you for opening this issue!

Could you please describe your use case why you need to use protocol in your streamlit app?

This probably a issue on interaction with Cloud / Streamlit Open source library, since Streamlit apps there deployed under reverse proxy, so most probably corresponding headers doesn't pass to Streamlit app itself.

@wyattscarpenter
Copy link
Author

wyattscarpenter commented May 6, 2024 via email

@vdonato vdonato added priority:P4 feature:community-cloud Related to Streamlit Community Cloud and removed status:needs-triage Has not been triaged by the Streamlit team labels May 6, 2024
@vdonato
Copy link
Collaborator

vdonato commented May 6, 2024

Hi @wyattscarpenter,

I'm not sure if there's much we can do about this in the Streamlit OS lib side. The issue is most likely because, in a Community Cloud deployment, the connection is indeed an http connection since the TLS connection isn't terminated by the Streamlit server, it's terminated at the load balancer level (and security is maintained by having the network permissions set such that the Streamlit server only accepts traffic from the load balancer in front of it).

This would be true of any deployment made where the Streamlit server itself isn't configured to terminate the TLS connection, and while we do have some basic configurability for this included in our config options (see the server.sslCertFile and server.sslKeyFile), it's unlikely we'll add full support for this in Community Cloud given the community focus of the product.

@wyattscarpenter
Copy link
Author

Interesting!

Well, fixing this isn't crucial for me, so feel free to deprioritize it, etc.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature:community-cloud Related to Streamlit Community Cloud priority:P4 type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants