mirror of
https://github.com/MetaCubeX/mihomo.git
synced 2026-02-27 01:07:10 +00:00
chore: update quic-go to 0.57.1
This commit is contained in:
45
component/ca/auth.go
Normal file
45
component/ca/auth.go
Normal file
@@ -0,0 +1,45 @@
|
||||
package ca
|
||||
|
||||
import (
|
||||
"github.com/metacubex/tls"
|
||||
)
|
||||
|
||||
type ClientAuthType = tls.ClientAuthType
|
||||
|
||||
const (
|
||||
NoClientCert = tls.NoClientCert
|
||||
RequestClientCert = tls.RequestClientCert
|
||||
RequireAnyClientCert = tls.RequireAnyClientCert
|
||||
VerifyClientCertIfGiven = tls.VerifyClientCertIfGiven
|
||||
RequireAndVerifyClientCert = tls.RequireAndVerifyClientCert
|
||||
)
|
||||
|
||||
func ClientAuthTypeFromString(s string) ClientAuthType {
|
||||
switch s {
|
||||
case "request":
|
||||
return RequestClientCert
|
||||
case "require-any":
|
||||
return RequireAnyClientCert
|
||||
case "verify-if-given":
|
||||
return VerifyClientCertIfGiven
|
||||
case "require-and-verify":
|
||||
return RequireAndVerifyClientCert
|
||||
default:
|
||||
return NoClientCert
|
||||
}
|
||||
}
|
||||
|
||||
func ClientAuthTypeToString(t ClientAuthType) string {
|
||||
switch t {
|
||||
case RequestClientCert:
|
||||
return "request"
|
||||
case RequireAnyClientCert:
|
||||
return "require-any"
|
||||
case VerifyClientCertIfGiven:
|
||||
return "verify-if-given"
|
||||
case RequireAndVerifyClientCert:
|
||||
return "require-and-verify"
|
||||
default:
|
||||
return ""
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package ca
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
_ "embed"
|
||||
"errors"
|
||||
@@ -13,6 +12,8 @@ import (
|
||||
"github.com/metacubex/mihomo/common/once"
|
||||
C "github.com/metacubex/mihomo/constant"
|
||||
"github.com/metacubex/mihomo/ntp"
|
||||
|
||||
"github.com/metacubex/tls"
|
||||
)
|
||||
|
||||
var globalCertPool *x509.CertPool
|
||||
|
||||
@@ -7,13 +7,14 @@ import (
|
||||
"crypto/elliptic"
|
||||
"crypto/rand"
|
||||
"crypto/rsa"
|
||||
"crypto/tls"
|
||||
"crypto/x509"
|
||||
"encoding/pem"
|
||||
"fmt"
|
||||
"math/big"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
"github.com/metacubex/tls"
|
||||
)
|
||||
|
||||
type Path interface {
|
||||
|
||||
Reference in New Issue
Block a user