Skip to content

feat(crypto): enabled the use of certificate/key pairs from disk vs. …#66

Open
jinncoder wants to merge 4 commits intosubspacecommunity:masterfrom
jinncoder:master
Open

feat(crypto): enabled the use of certificate/key pairs from disk vs. …#66
jinncoder wants to merge 4 commits intosubspacecommunity:masterfrom
jinncoder:master

Conversation

@jinncoder
Copy link
Copy Markdown

@jinncoder jinncoder commented May 22, 2020

enabled the use of certificate/key pairs from disk vs. just using let's encrypt - issue#20

to:
cc: @subspacecommunity/subspace-maintainers
related to:
resolves: #20

Background

Requested in #20

Changes

Testing

Steps for how this change was tested and verified

Generate a certificate/key pair in PEM format and try it out on the command line:

openssl req -newkey rsa:2048 -nodes -keyout key.pem -x509 -days 365 -out certificate.pem

Comment thread main.go Outdated
Copy link
Copy Markdown

@jack1902 jack1902 left a comment

Choose a reason for hiding this comment

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

LGTM, just need to remove the os.Exit calls after a log.Fatal https://golang.org/src/log/log.go?s=10156:10184#L320

Comment thread main.go
Comment thread main.go Outdated
Comment thread main.go Outdated
Comment thread main.go Outdated
Copy link
Copy Markdown

@gavinelder gavinelder left a comment

Choose a reason for hiding this comment

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

I need to do a more in-depth review locally but have addressed some initial concerns.

Comment thread main.go
Comment thread main.go Outdated

// Plain text web server for use behind a reverse proxy.
if !letsencrypt {
if !letsencrypt && tlsCertificate == "" || tlsKey == "" {
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
if !letsencrypt && tlsCertificate == "" || tlsKey == "" {
if !letsencrypt || tlsCertificate == "" || tlsKey == "" {

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

when:
  le == false 
  kp == true

(!le || kp) then pass (which we don't want, correct?)

when:
  le == false 
  kp == true

(!le && cert) then fail (which is what we want, no?)

So it should stay a && and not be changed to a || - or am I missing it?

Comment thread main.go Outdated
Comment thread main.go
Comment on lines +344 to +351
httpsd := &http.Server{
Handler: r,
Addr: httpAddr,
WriteTimeout: httpTimeout,
ReadTimeout: httpTimeout,
MaxHeaderBytes: maxHeaderBytes,
}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

I need to check out the PR on my own machine but this looks like it's in the wrong place.

@jinncoder
Copy link
Copy Markdown
Author

It's been a few days - any other issues which need be resolved before merging?

@dahendel
Copy link
Copy Markdown

dahendel commented Aug 9, 2021

Is there a possibility this might get merged soon?

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@jinncoder
Copy link
Copy Markdown
Author

@agonbar

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.

Has any thought been given to allowing standard TLS certificates

4 participants