Skip to main content

Ṣeto Awọn iwe ẹri SSL

Tẹle awọn itọsọna wọnyi lati seto iwe ẹri SSL kan lati ṣiṣẹ bi ibiiforukọsilẹ NPM kan lori HTTPS.

  • Update the listen property in your ~/.config/verdaccio/config.yaml:
listen: 'https://your.domain.com/'

Lọgan ti o ti se imudojuiwọn ohun elo itẹtisi ati gbigbiyanju lati ṣe imuṣiṣẹ verdaccio lẹẹkansi, yoo beere fun awọn iwe ẹri.

  • Generate your certificates
 $ openssl genrsa -out /Users/user/.config/verdaccio/verdaccio-key.pem 2048
$ openssl req -new -sha256 -key /Users/user/.config/verdaccio/verdaccio-key.pem -out /Users/user/.config/verdaccio/verdaccio-csr.pem
$ openssl x509 -req -in /Users/user/.config/verdaccio/verdaccio-csr.pem -signkey /Users/user/.config/verdaccio/verdaccio-key.pem -out /Users/user/.config/verdaccio/verdaccio-cert.pem
  • Edit your config file /Users/user/.config/verdaccio/config.yaml and add the following section:
https:
key: /Users/user/.config/verdaccio/verdaccio-key.pem
cert: /Users/user/.config/verdaccio/verdaccio-cert.pem
ca: /Users/user/.config/verdaccio/verdaccio-csr.pem

https: key: /Users/user/.config/verdaccio/verdaccio-key.pem cert: /Users/user/.config/verdaccio/verdaccio-cert.pem ca: /Users/user/.config/verdaccio/verdaccio-csr.pem

https:
pfx: /Users/user/.config/verdaccio/server.pfx
passphrase: 'secret'

https: pfx: /Users/user/.config/verdaccio/server.pfx passphrase: 'secret' ````

  • Run verdaccio in your command line.

  • Open the browser and visit https://your.domain.com:port/

O le ri alaye diẹ sii lori awọn ariyanjiyan key, cert, ca, pfx, ati passphrase ni Iwe akọsilẹ Oju ipade

Docker

Awọn itọsọna wọnyi ma n saba fẹsẹmulẹ labẹ OSX ati Linux; lori Windows awọn ọna naa yoo yatọ, ṣugbọn awọn igbesẹ naa jẹ bakanna.

Ti o ba n lo aworan Docker, o ni lati ṣeto iyipada ayika VERDACCIO_PROTOCOL si https, gẹgẹ bi ariyanjiyan listen se jẹ pipese ninu Dockerfile naa ati pe o foju fo ti inu faili iṣeto rẹ.