Skip to content

Commit

Permalink
Default to TLS 1.2 as minimum version (#62)
Browse files Browse the repository at this point in the history
* first draft

* default server params should setup tls min version

* make the default server created secure by default
  • Loading branch information
jmcampanini authored Sep 9, 2021
1 parent 6958848 commit c1d302b
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion baseapp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ package baseapp

import (
"context"
"crypto/tls"
"encoding/json"
"fmt"
"net/http"
Expand Down Expand Up @@ -76,7 +77,11 @@ func NewServer(c HTTPConfig, params ...Param) (*Server, error) {
}

if base.server == nil {
base.server = &http.Server{}
base.server = &http.Server{
TLSConfig: &tls.Config{
MinVersion: tls.VersionTLS12,
},
}
}

if base.server.Addr == "" {
Expand Down

0 comments on commit c1d302b

Please sign in to comment.