Skip to content

Commit 2422b3d

Browse files
committed
Initialize Convergence's NSS.js with nss library path (EFForg#8314)
Fixes NSS module load on Macs and gets rid of a startup error message on console
1 parent 5bf22f6 commit 2422b3d

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

src/chrome/content/code/NSS.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,10 @@ NSS.initialize = function(nssPath) {
3131
try {
3232
sharedLib = ctypes.open(nssPath);
3333
} catch (e) {
34-
dump("Failed to find nss3 in installed directory, checking system paths.\n");
35-
sharedLib = ctypes.open(ctypes.libraryName("nss3"));
34+
Components.utils.import("resource://gre/modules/Services.jsm");
35+
var nssFile = Services.dirsvc.get("GreD", Ci.nsILocalFile);
36+
nssFile.append(ctypes.libraryName("nss3"));
37+
sharedLib = ctypes.open(nssFile.path);
3638
}
3739

3840
NSS.types = new Object();

src/components/ssl-observatory.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ function SSLObservatory() {
137137
this.setupASNWatcher();
138138

139139
try {
140-
NSS.initialize("");
140+
NSS.initialize(ctypes.libraryName("nss3"));
141141
} catch(e) {
142142
this.log(WARN, "Failed to initialize NSS component:" + e);
143143
}

0 commit comments

Comments
 (0)