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

Addition of HTTPS support #79

Merged
merged 6 commits into from
Jul 6, 2023
Merged

Conversation

KasKatto
Copy link
Contributor

@KasKatto KasKatto commented Jul 6, 2023

New init overload that accepts a ssl context (OpenSSL::SSL::Context::Server class type). When the server is started it uses #bind_tls instead of #bind_tcp. HTTP can still be used, if you dont provide the ssl context.

Example:

ssl_context = OpenSSL::SSL::Context::Server.new
ssl_context.certificate_chain= "example.crt"
ssl_context.private_key= "example.key"

server = ActionController::Server.new(ssl_context, "0.0.0.0", 5000)

server.run()

@stakach stakach self-requested a review July 6, 2023 22:04
Copy link
Member

@stakach stakach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great idea!

src/action-controller/server.cr Outdated Show resolved Hide resolved
src/action-controller/server.cr Outdated Show resolved Hide resolved
@stakach
Copy link
Member

stakach commented Jul 6, 2023

I removed the not_nils

@stakach stakach merged commit 0982b4c into spider-gazelle:master Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants