Skip to content

Commit

Permalink
Merge pull request #5 from stdtom/rfc7468
Browse files Browse the repository at this point in the history
  • Loading branch information
jkroepke authored Apr 14, 2024
2 parents 2e4bd07 + e310c72 commit f1dae01
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/secret-details.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,14 @@ export class SecretDetails extends React.Component<Renderer.Component.KubeObject
"base64"
).toString("ascii");

if (!certificateString.startsWith("-----BEGIN CERTIFICATE-----"))
const PEM_CERTIFICATE_HEADER = "-----BEGIN CERTIFICATE-----";
const PEM_CERTIFICATE_FOOTER = "-----END CERTIFICATE-----";

if (!certificateString.includes(PEM_CERTIFICATE_HEADER) ||
!certificateString.includes(PEM_CERTIFICATE_FOOTER)) {
// The certificate string does not have the correct PEM format
continue;
}

try {
let secureContext = tls.createSecureContext({
Expand Down

0 comments on commit f1dae01

Please sign in to comment.