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

Fabo/595 https #601

Closed
wants to merge 5 commits into from
Closed

Fabo/595 https #601

wants to merge 5 commits into from

Conversation

faboweb
Copy link
Contributor

@faboweb faboweb commented Mar 9, 2018

Add https to the REST server.

Closes: #595

Feedback welcome!
Should we add an option to set the certificate location?

@faboweb faboweb requested a review from ebuchman as a code owner March 9, 2018 11:59
@faboweb faboweb changed the base branch from master to develop March 9, 2018 12:00
@codecov
Copy link

codecov bot commented Mar 9, 2018

Codecov Report

Merging #601 into develop will not change coverage.
The diff coverage is n/a.

@@           Coverage Diff            @@
##           develop     #601   +/-   ##
========================================
  Coverage    57.16%   57.16%           
========================================
  Files           33       33           
  Lines         1807     1807           
========================================
  Hits          1033     1033           
  Misses         693      693           
  Partials        81       81

@zmanian
Copy link
Member

zmanian commented Mar 11, 2018

Would you like some help with generating certificates as per the example in #595

@faboweb
Copy link
Contributor Author

faboweb commented Mar 12, 2018

@zmanian I would love your help, if you have some time to spend! :-)

@jbibla
Copy link
Contributor

jbibla commented Mar 12, 2018

@mappum can you summarize the discussion that took place at full node regarding node child processes and https?

@martindale martindale added this to the "Double Chubble" milestone Mar 12, 2018
@zmanian
Copy link
Member

zmanian commented Mar 15, 2018

So I feel there are something I need to fix here.

  1. We should check that the cerificate is still valid on startup and replace it if it was self-signed and expired.

  2. Also needs print the hash of the public key

pem.Encode(keyOut, pemBlockForKey(privKey))
keyOut.Close()

validFor := time.Duration(365 * 24 * time.Hour)
Copy link
Contributor

Choose a reason for hiding this comment

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

time.Duration(8760 * time.Hour) // 365 * 24 = 8760

Copy link
Contributor

Choose a reason for hiding this comment

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

Why change this if the compiler is just going to simplify it anyway?

Copy link
Contributor

Choose a reason for hiding this comment

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

@mappum cool - obviously the compiler would simplify... I take it back! way clearer to leave as is :)

@faboweb
Copy link
Contributor Author

faboweb commented Mar 27, 2018

Where are we on this?

@melekes
Copy link
Contributor

melekes commented Apr 11, 2018

Question: why don't use something like Nginx to terminate SSL https://docs.nginx.com/nginx/admin-guide/security-controls/terminating-ssl-http/ ?

os.IsNotExist(err)

if err != nil {
err = generateAndSaveCertificate(exPath)
Copy link
Contributor

Choose a reason for hiding this comment

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

do you use https://letsencrypt.org/ ? or is this just generates raw/unconfirmed certificate?

Copy link
Member

Choose a reason for hiding this comment

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

These should not be certificates signed by a public certificate authority. They need to be generated locally.

exPath := filepath.Dir(ex)

_, err = os.Stat(filepath.Join(exPath, "server.crt"))
os.IsNotExist(err)
Copy link
Contributor

Choose a reason for hiding this comment

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

why do this if you're not checking for the output (bool)?

}
exPath := filepath.Dir(ex)

_, err = os.Stat(filepath.Join(exPath, "server.crt"))
Copy link
Contributor

Choose a reason for hiding this comment

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

const serverCertificateFile = "server.crt"


_, err = os.Stat(filepath.Join(exPath, "server.crt"))
os.IsNotExist(err)
_, err = os.Stat(filepath.Join(exPath, "server.key"))
Copy link
Contributor

Choose a reason for hiding this comment

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

const serverKeyFile = "server.key"

@zmanian
Copy link
Member

zmanian commented Apr 11, 2018

The reason not to use nginx is that TLS is needed to secure the communication between voyager and the LCD rest server and we shouldn't ship nginx with voyager. In an enterprise setting other configuration might make sense and then the rest server can be started with the --insecure flag

@melekes
Copy link
Contributor

melekes commented Apr 11, 2018

Thanks for explaining this.

@zmanian
Copy link
Member

zmanian commented Apr 11, 2018

This code needs a non-trivial rebase and some new features before it can be merged.

I'm done traveling for some days and i hopefully can get this ready shortly.

@rigelrozanski
Copy link
Contributor

As per conversation with @zmanian this PR will be closed and new one opened based on updated develop branch.. this PR's branch is going to be saved under zaki/reference-595-https

@rigelrozanski rigelrozanski deleted the fabo/595-https branch April 18, 2018 19:09
p0mvn pushed a commit that referenced this pull request May 11, 2024
* Don't run ValidateBasic on recheck (#601)

(cherry picked from commit de3aaa1)

* update changelog

---------

Co-authored-by: Dev Ojha <[email protected]>
Co-authored-by: Adam Tucker <[email protected]>
p0mvn pushed a commit that referenced this pull request May 16, 2024
MalteHerrmann pushed a commit to MalteHerrmann/cosmos-sdk that referenced this pull request Sep 25, 2024
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.

7 participants