Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support secure protocol #38

Open
smelukov opened this issue Jul 16, 2018 · 5 comments
Open

support secure protocol #38

smelukov opened this issue Jul 16, 2018 · 5 comments

Comments

@smelukov
Copy link

When we use ldaps://... in the config then we get an error

 fatal--- uncaught exception, please report this
Error: unable to get local issuer certificate
    at TLSSocket.<anonymous> (_tls_wrap.js:1105:38)
    at emitNone (events.js:106:13)
    at TLSSocket.emit (events.js:208:7)
    at TLSSocket._finishInit (_tls_wrap.js:639:8)
    at TLSWrap.ssl.onhandshakedone (_tls_wrap.js:469:38)
@smelukov
Copy link
Author

The reason is self-signed certificate

@Alexandre-io
Copy link
Owner

For self signed certificate you can add:

auth:
  ldap:
    type: ldap
    groupNameAttribute: 'cn'
    client_options:
      tlsOptions:
        rejectUnauthorized: false

@smelukov
Copy link
Author

@Alexandre-io rejectUnauthorized is deprecated
We were passed certificates content instead of rejectUnauthorized

@smelukov smelukov reopened this Jul 24, 2018
@C-Duv
Copy link

C-Duv commented Oct 10, 2018

For anyone wondering, here is a way to tell a Dockerized Node to trust some certificates:

  • Place your certificates (as PEM) into a extra-certs.pem file (on your host)
  • Make sure this file extra-certs.pem gets copied into image's directory /verdaccio/conf (eg. docker run -v /some/path/on/host/my_verdaccio_docker/conf:/verdaccio/conf/).
  • Add --env NODE_EXTRA_CA_CERTS=/verdaccio/conf/extra-certs.pem to the docker run command.

@jzielke84
Copy link

jzielke84 commented Nov 13, 2019

@C-Duv Does this apply only for the Docker-Version or for a general npm setup on bare metal?
I tired to debug it myself but when clicking login, the application just sits there and no logfile entry is generated until it says "couldn't log in" after like 30 seconds - even in debug mode. Would appreciate some help from @smelukov or @Alexandre-io on how to fix that, since clear text ldap is a no-go from a security perspective.

EDIT: OK it seems like the port in the URL was causing the problems. I don't know where I got that from but there are so many ldap exmaples for verdaccio out there, that I probably got an outdated example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants