Skip to content

Commit 46f6a53

Browse files
authored
fix: update SSL pinning certificate handling to ensure valid certificate is used (#6656)
1 parent 13d264f commit 46f6a53

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

app/lib/methods/helpers/sslPinning.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,11 +79,11 @@ const RCSSLPinning = Platform.select({
7979
}),
8080
setCertificate: (name: string, server: string) => {
8181
if (name) {
82-
let certificate = UserPreferences.getMap(name) as ICertificate;
83-
if (!certificate.path.match(extractFileScheme(documentDirectory!))) {
84-
certificate = persistCertificate(server, name, certificate.password);
82+
const certificate = UserPreferences.getMap(name) as ICertificate;
83+
if (certificate) {
84+
persistCertificate(server, name, certificate.password);
85+
SSLPinning?.setCertificate(server, certificate.path, certificate.password);
8586
}
86-
SSLPinning?.setCertificate(server, certificate.path, certificate.password);
8787
}
8888
},
8989
removeCertificate

0 commit comments

Comments
 (0)