Skip to content

Fix issue 16 #22

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

Closed
wants to merge 3 commits into from
Closed

Fix issue 16 #22

wants to merge 3 commits into from

Conversation

nullstd
Copy link

@nullstd nullstd commented Feb 27, 2020

This is supposed to handle \n in PEM certificate, so that v2ray could correctly receive the right certificate content.

In addition, V2ray only accepts certRaw in PEM format, so it's necessary to change type to application/x-pem-file

@Mygod
Copy link
Collaborator

Mygod commented Feb 27, 2020

As I said, I think the ideal way to fix this is to remove all the linebreaks in the middle and wrap the encoded certificate with BEGIN END blocks.

@Mygod
Copy link
Collaborator

Mygod commented Feb 27, 2020

Please update your fix accordingly.

@nullstd
Copy link
Author

nullstd commented Feb 28, 2020

I tried that way, but it didn't work.

All the line breaks in the middle in addition to BEGIN and END blocks are necessary to generate a valid byte array. Otherwise Go Language's certificate API won't recognize it as a valid PEM format certificate. Therefore stripping the line breaks in the middle is not feasible.

@Mygod @madeye

@lixin9311
Copy link
Collaborator

I can't see why we explicitly escape \n here, just leave it as it is.

@nullstd nullstd closed this Apr 6, 2022
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.

3 participants