MCPcopy Create free account
hub / github.com/IceFireDB/IceFireDB / NewDefaultServer

Function NewDefaultServer

IceFireDB-SQLite/pkg/mysql/server/server_conf.go:46–61  ·  view source on GitHub ↗

NewDefaultServer: New mysql server with default settings. NOTES: TLS support will be enabled by default with auto-generated CA and server certificates (however, you can still use non-TLS connection). By default, it will verify the client certificate if present. You can enable TLS support on the cli

()

Source from the content-addressed store, hash-verified

44// the client side without providing a client-side certificate. So only when you need the server to verify client
45// identity for maximum security, you need to set a signed certificate for the client.
46func NewDefaultServer() *Server {
47 caPem, caKey := generateCA()
48 certPem, keyPem := generateAndSignRSACerts(caPem, caKey)
49 tlsConf := NewServerTLSConfig(caPem, certPem, keyPem, tls.VerifyClientCertIfGiven)
50 return &Server{
51 serverVersion: "5.7.0",
52 protocolVersion: 10,
53 capability: CLIENT_LONG_PASSWORD | CLIENT_LONG_FLAG | CLIENT_CONNECT_WITH_DB | CLIENT_PROTOCOL_41 |
54 CLIENT_TRANSACTIONS | CLIENT_SECURE_CONNECTION | CLIENT_PLUGIN_AUTH | CLIENT_SSL | CLIENT_PLUGIN_AUTH_LENENC_CLIENT_DATA,
55 collationId: DEFAULT_COLLATION_ID,
56 defaultAuthMethod: AUTH_NATIVE_PASSWORD,
57 pubKey: getPublicKeyFromCert(certPem),
58 tlsConfig: tlsConf,
59 cacheShaPassword: new(sync.Map),
60 }
61}
62
63// NewServer: New mysql server with customized settings.
64//

Callers 2

newMysqlProxyFunction · 0.92
server_conf.goFile · 0.70

Calls 4

generateCAFunction · 0.70
generateAndSignRSACertsFunction · 0.70
NewServerTLSConfigFunction · 0.70
getPublicKeyFromCertFunction · 0.70

Tested by

no test coverage detected