Git Product home page Git Product logo

Comments (2)

Erikvv avatar Erikvv commented on August 19, 2024

The answer all depends on how you implement net.Listener you pass to

func (s *Server) Serve(ctx context.Context, lis net.Listener) (err error) {
for the server and net.Conn you pass to
func New(tr drpc.Transport) *Conn {
for the client

I will give some answers for the general case where you use the tls package from the Go standard library.

My concern is what happens when an SSL cert expires, or a certificate is changed (because a cert is due to expire shortly), and the client has an active connection to the dRPC server.

Will the client's connection be killed automatically?

The certificate is only validated on handshake. So the connection will keep working. Also certificates are renewed well before they expire, Let's Encrypt certificates are valid for 3 months and renewed after 2 months.

(If you read the TLS spec the server or client can renegotiate at any time but I haven't seen this in the wild.)

Will the client retrieve the new SSL certificate automatically?

The client will validate the certicate against the "parent" certificate in his CA store. These certificates are valid for a multiple years, and are usually updated by your operating system.

I am planning on using Let'sEncrypt autocert to automatically renew certs without requiring a server restart.

In that case you must periodically re-initialize tls.listener or implement tls.Config.GetCertificate.

Note that Let's Encrypt only works for server certificates. If you want to work with client verification you have to generate the client certificate yourself.

At Storj we developed something called NodeID verification to communicate between the thousands of actors in our network which (I think) does both client and server verifcation through TLS certificates. I'm quite fond of it but it would be overkill for a small project. Implementation is at https://github.com/storj/common/blob/main/peertls/tlsopts/tls.go

Hope this helps!

from drpc.

nullbio avatar nullbio commented on August 19, 2024

Thanks so much for your thorough response, this answers all my questions. Awesome job on dRPC and Storj, both products look incredible :-).

from drpc.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.