@trash-streamers/common 1.2.50 → 1.2.51
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -56,14 +56,20 @@ let GrpcClientFactory = class GrpcClientFactory {
|
|
|
56
56
|
createClient(options) {
|
|
57
57
|
let credentials = grpc.credentials.createInsecure();
|
|
58
58
|
if (options.secure) {
|
|
59
|
-
const
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
59
|
+
const CA_PEM = `-----BEGIN CERTIFICATE-----
|
|
60
|
+
MIIDWzCCAkOgAwIBAgIULC3LplY9Eb6Bgk4dLVPd6pNYojIwDQYJKoZIhvcNAQEL
|
|
61
|
+
...остальной код сертификата...
|
|
62
|
+
-----END CERTIFICATE-----`;
|
|
63
|
+
const CERT_PEM = `-----BEGIN CERTIFICATE-----
|
|
64
|
+
MIIDSTCCAjGgAwIBAgIUfNy8qyRJ19+DfgdBTdo1KgeEffMwDQYJKoZIhvcNAQEL
|
|
65
|
+
...
|
|
66
|
+
-----END CERTIFICATE-----`;
|
|
67
|
+
const KEY_PEM = `-----BEGIN PRIVATE KEY-----
|
|
68
|
+
MIIEoQIBAAKCAQEAuGZUdgd7J9zjWxzqp1s5kJGuDtYWdatxaBiuCLjb3ugzlRed
|
|
69
|
+
...
|
|
70
|
+
-----END PRIVATE KEY-----`;
|
|
71
|
+
// 2. Передавайте Buffer напрямую из строк (без base64 декодинга вручную)
|
|
72
|
+
credentials = grpc.credentials.createSsl(Buffer.from(CA_PEM), Buffer.from(KEY_PEM), Buffer.from(CERT_PEM));
|
|
67
73
|
}
|
|
68
74
|
return microservices_1.ClientProxyFactory.create({
|
|
69
75
|
transport: microservices_1.Transport.GRPC,
|