Fix string type

This commit is contained in:
世界
2026-07-25 22:57:06 +08:00
parent ea6965b726
commit f60f3728ce
7 changed files with 9 additions and 123 deletions
+1 -1
View File
@@ -188,7 +188,7 @@ func newSTDClient(ctx context.Context, logger logger.ContextLogger, serverAddres
if len(certificate) > 0 {
certPool := x509.NewCertPool()
if !certPool.AppendCertsFromPEM(certificate) {
return nil, E.New("failed to parse certificate:\n\n", certificate)
return nil, E.New("failed to parse certificate:\n\n", string(certificate))
}
tlsConfig.RootCAs = certPool
}
+1 -1
View File
@@ -289,7 +289,7 @@ func (c *STDServerConfig) certificateUpdated(path string) error {
for _, certPath := range c.clientCertificatePath {
content, err := filemanager.ReadFile(c.ctx, certPath)
if err != nil {
c.logger.Error(E.Cause(err, "reload certificate from ", c.clientCertificatePath))
c.logger.Error(E.Cause(err, "reload certificate from ", certPath))
continue
}
if !clientCertificateCA.AppendCertsFromPEM(content) {
+1 -1
View File
@@ -260,7 +260,7 @@ func newUTLSClient(ctx context.Context, logger logger.ContextLogger, serverAddre
if len(certificate) > 0 {
certPool := x509.NewCertPool()
if !certPool.AppendCertsFromPEM(certificate) {
return nil, E.New("failed to parse certificate:\n\n", certificate)
return nil, E.New("failed to parse certificate:\n\n", string(certificate))
}
tlsConfig.RootCAs = certPool
}