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

OpenSSL: use Windows' system root certificate store #13187

Conversation

HertzDevil
Copy link
Contributor

Resolves #12476. This makes things like HTTP::Client.get("https://example.com") work on Windows without any user configuration at all. (The problem technically still exists for non-system certificates, but then non-Windows systems have to face the same problem too.)

@beta-ziliani
Copy link
Member

Awesome! 🙇
Wouldn't it be best to import the lib functions following the Crystal conventions? E.g.,

fun cert_enum_certificates_in_store = CertEnumCertificatesInStore(...)

@HertzDevil
Copy link
Contributor Author

Not the Win32 C bindings, they don't change case for some reason

@straight-shoota
Copy link
Member

I don't think we adapt the spelling of lib symbols to Crystal conventions anywhere. Except when necessary due to syntax restrictions (such as downcasing the first character).

Copy link
Member

@straight-shoota straight-shoota left a comment

Choose a reason for hiding this comment

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

Could you add a short comment in ssl/context.cr to explain why populate_system_root_certificates is only used on windows?

src/crystal/system/win32/crypto.cr Outdated Show resolved Hide resolved
src/crystal/system/win32/crypto.cr Outdated Show resolved Hide resolved
@straight-shoota straight-shoota added this to the 1.8.0 milestone Mar 15, 2023
@straight-shoota straight-shoota merged commit 012e92e into crystal-lang:master Mar 16, 2023
@HertzDevil HertzDevil deleted the feature/windows-system-root-certificates branch March 16, 2023 18:52
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Distributing CA certificates for OpenSSL on Windows
3 participants