Installation of certificate in all Node products: הבדלים בין גרסאות בדף

מתוך ויקי נטפרי
קפיצה לניווט קפיצה לחיפוש
מ (fix: use {{he}} for link to hebrew page instead of {{en}} (דרך WP:JWB))
 
(5 גרסאות ביניים של 2 משתמשים אינן מוצגות)
שורה 1: שורה 1:
{{עמוד בעברית|התקנת תעודה בכל מוצרי node}}
+
{{he|התקנת תעודה בכל מוצרי node}}
<div lang="en" dir="ltr">
+
{{Navigation|Security certificate}}
 +
 
 +
'''Update for windows systems: as of 3 May 2019, a [[Standard certificate installer|new certificate installation software]] was released, the new software automatically installs the certificate also in GIT'''
 +
 
 +
==Recommended option==
 +
 
 +
Download the certificate from the current NetFree provider you are connected to from here:
 +
 
 +
[//netfree.link/netfree-ca.crt http://netfree.link/netfree-ca.crt]
 +
 
 +
And keep it on the computer in a fixed location.
 +
 
 +
 
 +
windows:
  
{{Navigation|Security certificate}}
 
  
 
Download the certificate of your Provider of NetFree from here.
 
Download the certificate of your Provider of NetFree from here.
שורה 10: שורה 22:
 
Configure on your computer an Environment variable named NODE_EXTRA_CA_CERTS, whose value is the certificate address on the computer.
 
Configure on your computer an Environment variable named NODE_EXTRA_CA_CERTS, whose value is the certificate address on the computer.
  
(To define an environment variable in the system Windows, write in a command prompt opened in administrator mode:
+
To define an environment variable in the system Windows, write in a command prompt opened in administrator mode:
 +
 
 +
SetX NODE_EXTRA_CA_CERTS "C:\netfree-ca.crt" /m
 +
 
 +
Of course you have to change <code>‎C:\netfree-ca.crt</code> to the correct folder where the certificate was saved.
  
<code>
 
SetX NODE_EXTRA_CA_CERTS "C:\netfree-ca.crt" /m
 
</code>
 
  
Of course you have to change "C:\netfree-ca.crt" to the correct folder where the certificate was saved.
+
linux:
  
 
In Linux systems, open the profile file (/etc/profile) And write the following line at the end of the file:
 
In Linux systems, open the profile file (/etc/profile) And write the following line at the end of the file:
  
<code>
+
export NODE_EXTRA_CA_CERTS=/path/to/netfree-ca.crt
export NODE_EXTRA_CA_CERTS=/netfree-ca.crt
 
</code>
 
  
Here too, verify that the certificate is in / or write the folder where it is located).
+
Change the path <code>‎/path/to/netfree-ca.crt</code> to the path where you saved the certificate you downloaded, and open a new terminal window.
  
 +
 +
mac:
 +
 +
You need to set an environment variable for the profile file of the command-line environment that you are using.
 +
 +
* If you use '''bash''', the profile file is in the path <code>bash_profile./~</code>  Or in the path <code>bashrc./~</code>
 +
 +
* If you use '''zsh''' (default from -Catalina 10.15 onwards), the profile file is in the path <code>zshenv./~</code>
 +
 +
* If you use '''Oh my zsh''', the profile file is in the path <code>zshrc./~</code>
 +
 +
Run the following command according to the path of your current profile file, and of course <code>path/to/netfree-ca.crt/</code> replace with the path where you saved the certificate you downloaded:
 +
 +
echo export NODE_EXTRA_CA_CERTS=/path/to/netfree-ca.crt >> ~/.zshenv
 +
 +
And activate a new terminal window.
 +
 +
 +
==Another option==
  
 
If the setting does not work because it is an old version or it is electron, add this code somewhere in the software.
 
If the setting does not work because it is an old version or it is electron, add this code somewhere in the software.
שורה 51: שורה 81:
  
  
Alternatively you can also cancel the need for a certificate by canceling security, on every node run and things based on it:
+
 
 +
 
 +
==Option to cancel security check==
 +
 
 +
Alternatively you can also cancel the need for a certificate by canceling security, on every node run and things based on it (not recommended as a permanent solution):
  
  
 
Run at the command prompt.
 
Run at the command prompt.
  
In Linux
+
In linux\mac:
  
 
<pre>export NODE_TLS_REJECT_UNAUTHORIZED=0</pre>
 
<pre>export NODE_TLS_REJECT_UNAUTHORIZED=0</pre>
  
In Windows
+
In windows:
  
 
<pre>set NODE_TLS_REJECT_UNAUTHORIZED=0</pre>
 
<pre>set NODE_TLS_REJECT_UNAUTHORIZED=0</pre>
שורה 66: שורה 100:
  
 
And then run the Node.
 
And then run the Node.
 +
 +
This will only help for the current terminal run.

גרסה אחרונה מ־04:10, 17 באוגוסט 2023

לעברית לחצו כאן

To switch from edit view to read view

To search in the Wiki

Home page > Security certificate > Installation of certificate in all Node products ‎‎


Update for windows systems: as of 3 May 2019, a new certificate installation software was released, the new software automatically installs the certificate also in GIT

Recommended option

Download the certificate from the current NetFree provider you are connected to from here:

http://netfree.link/netfree-ca.crt

And keep it on the computer in a fixed location.


windows:


Download the certificate of your Provider of NetFree from here. http://netfree.link/netfree-ca.crt Save it on your computer where you want but in a fixed place.

Configure on your computer an Environment variable named NODE_EXTRA_CA_CERTS, whose value is the certificate address on the computer.

To define an environment variable in the system Windows, write in a command prompt opened in administrator mode:

SetX NODE_EXTRA_CA_CERTS "C:\netfree-ca.crt" /m

Of course you have to change ‎C:\netfree-ca.crt to the correct folder where the certificate was saved.


linux:

In Linux systems, open the profile file (/etc/profile) And write the following line at the end of the file:

export NODE_EXTRA_CA_CERTS=/path/to/netfree-ca.crt

Change the path ‎/path/to/netfree-ca.crt to the path where you saved the certificate you downloaded, and open a new terminal window.


mac:

You need to set an environment variable for the profile file of the command-line environment that you are using.

  • If you use bash, the profile file is in the path bash_profile./~ Or in the path bashrc./~
  • If you use zsh (default from -Catalina 10.15 onwards), the profile file is in the path zshenv./~
  • If you use Oh my zsh, the profile file is in the path zshrc./~

Run the following command according to the path of your current profile file, and of course path/to/netfree-ca.crt/ replace with the path where you saved the certificate you downloaded:

echo export NODE_EXTRA_CA_CERTS=/path/to/netfree-ca.crt >> ~/.zshenv

And activate a new terminal window.


Another option

If the setting does not work because it is an old version or it is electron, add this code somewhere in the software.

(function(){
	if(!process.env.NODE_EXTRA_CA_CERTS) return;
	try{
		var netfreeCa = require("fs").readFileSync(process.env.NODE_EXTRA_CA_CERTS);
	}catch(e){
		return;
	}
	
	var NativeSecureContext = process.binding('crypto').SecureContext;
	var oldaddRootCerts = NativeSecureContext.prototype.addRootCerts;
	NativeSecureContext.prototype.addRootCerts = function(){
		var ret = oldaddRootCerts.apply(this,arguments);
		this.addCACert(netfreeCa);
		return ret;
	};
})();



Option to cancel security check

Alternatively you can also cancel the need for a certificate by canceling security, on every node run and things based on it (not recommended as a permanent solution):


Run at the command prompt.

In linux\mac:

export NODE_TLS_REJECT_UNAUTHORIZED=0

In windows:

set NODE_TLS_REJECT_UNAUTHORIZED=0


And then run the Node.

This will only help for the current terminal run.