Skip to content

Commit

Permalink
Add: TLS, mTLS & OCSP,CRL certificate verification
Browse files Browse the repository at this point in the history
Signed-off-by: Arvindh <arvindh91@gmail.com>
  • Loading branch information
arvindh123 committed Mar 7, 2024
1 parent 9eb6ff1 commit d90128f
Showing 1 changed file with 0 additions and 45 deletions.
45 changes: 0 additions & 45 deletions pkg/tls/tls.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@
package tls

import (
"bytes"
"crypto"
"bytes"
"crypto"
"crypto/tls"
Expand All @@ -14,13 +12,9 @@ import (
"errors"
"fmt"
"io"
"fmt"
"io"
"net"
"net/http"
"net/url"
"net/http"
"net/url"
"os"
"strings"
"time"
Expand Down Expand Up @@ -80,45 +74,6 @@ func (s Security) String() string {
return "without TLS"
}
}
errTLSdetails = errors.New("failed to get TLS details of connection")
errParseRoot = errors.New("failed to parse root certificate")
errLoadCerts = errors.New("failed to load certificates")
errLoadServerCA = errors.New("failed to load Server CA")
errLoadClientCA = errors.New("failed to load Client CA")
errAppendCA = errors.New("failed to append root ca tls.Config")
errClientCrt = errors.New("client certificate not received")
errRetrieveIssuerCrt = errors.New("failed to retrieve issuer certificate")
errReadIssuerCrt = errors.New("failed to read issuer certificate")
errParseIssuerCrt = errors.New("failed to parse issuer certificate")
errCreateOCSPReq = errors.New("failed to create OCSP Request")
errCreateOCSPHTTPReq = errors.New("failed to create OCSP HTTP Request")
errParseOCSPUrl = errors.New("failed to parse OCSP server URL")
errOCSPReq = errors.New("OCSP request failed")
errOCSPReadResp = errors.New("failed to read OCSP response")
errParseOCSPRespForCert = errors.New("failed to parse OCSP Response for Certificate")
errParseCert = errors.New("failed to parse Certificate")
)

type Security int

const (
WithoutTLS Security = iota
WithTLS
WithmTLS
)

func (s Security) String() string {
switch s {
case WithTLS:
return "with TLS"
case WithmTLS:
return "with mTLS"
case WithoutTLS:
fallthrough
default:
return "without TLS"
}
}

type ValidateMethod int

Expand Down

0 comments on commit d90128f

Please sign in to comment.