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

OneLogin::RubySaml.format_cert break a cert with comment #513

Closed
cyc115 opened this issue Oct 2, 2019 · 3 comments
Closed

OneLogin::RubySaml.format_cert break a cert with comment #513

cyc115 opened this issue Oct 2, 2019 · 3 comments

Comments

@cyc115
Copy link

cyc115 commented Oct 2, 2019

OneLogin::RubySaml.format_cert strips out the BEGIN and END line then remove line breaks. This will break any cert with prefix and suffix comments like the example below:

comment
-----BEGIN CERTIFICATE-----
[...]
-----END CERTIFICATE-----
comment

The formatted certificate will be:


-----BEGIN CERTIFICATE-----
comment
[...]
comment
-----END CERTIFICATE-----

see:
https://github.com/onelogin/ruby-saml/blob/master/lib/onelogin/ruby-saml/utils.rb#L51

@pitbulk
Copy link
Collaborator

pitbulk commented Oct 2, 2019

Why you have comments on the certs? I guess that then those comments should be removed as well by the format_cert method. Do you have a PR?

@cyc115
Copy link
Author

cyc115 commented Oct 3, 2019

I forgot exactly which openssl command I run to generate the pem file but at least with some options openssl will generate cert with the human readable format prefixing the -----BEGIN CERTIFICATE-----.

I don't have a PR but am willing to write one if there's interest in this.

@pitbulk
Copy link
Collaborator

pitbulk commented Jan 3, 2023

Duplicated of #636. Will leave the other one open and close this one.

@pitbulk pitbulk closed this as completed Jan 3, 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

No branches or pull requests

2 participants