Skip to content

Fresh certificate has incorrect expiration date #304

Open

Description

@lukasz-gladek-av

While doing bower install I get following error:

#0 1.681 bower angular-elastic#2.4.2 CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/angular-elastic failed: certificate has expired
ERROR: failed to solve: process "/bin/bash -o pipefail -c bower install" did not complete successfully: exit code: 1

bower.io cert looks fine, but going to https://registry.bower.io/packages/angular-elastic it shows that cert is issued today, but it expires yesterday

Activity

  1. changed the title [-]Fresh certificate has wrong expiring date[/-] [+]Fresh certificate has incorrect expiration date[/+] on Apr 24, 2023
  2. mchrapek commented on Apr 24, 2023

    @mchrapek

    It's true that the certificate is issued today, but its expiration date is July 23.

    image

    It seems to me that something wrong with the new certificate because we have the same problem:

    bower angular#~1.5.0  CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/angular failed: certificate has expired
    
  3. PankajPatel007 commented on Apr 24, 2023

    @PankajPatel007

    I too facing the same issue.

    (node:16801) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
    Warning: Request to https://registry.bower.io/packages/angular-resource failed: certificate has expired Use --force to continue.`

  4. pejorativefox commented on Apr 24, 2023

    @pejorativefox

    Also seeing this in our CI/CD pipelines.

  5. ajayarjunan commented on Apr 24, 2023

    @ajayarjunan

    Same here, the SSL certificate needs to be properly created and installed for https://registry.bower.io/packages/ to get this resolved:

    Screenshot from 2023-04-24 15-32-11

  6. ajayarjunan commented on Apr 24, 2023

    @ajayarjunan

    As @mchrapek mentioned here:- bower/bower#2608 (comment), adding "strict-ssl": false to .bowerrc file made it worked

    Edit: This is not a recommended approach, but for testing only.

  7. mchrapek commented on Apr 24, 2023

    @mchrapek

    but I don't recommend this solution, disabling SSL can be dangerous, I did this just to check if the problem is with SSL

  8. galregev commented on Apr 24, 2023

    @galregev

    Im experiencing this behaviour from my Jenkins CI/CD for Docker image creation.
    Is there any temp solution? such as alterative registry? I don't want to disable SSL.

  9. khoros-chandrakala commented on Apr 24, 2023

    @khoros-chandrakala

    any idea when this can be sorted out, CI/CD is having the cert issue with installing the bower, looking for some solution without disabling SSL

  10. ajayarjunan commented on Apr 24, 2023

    @ajayarjunan

    From what we have noticed, this issue seems to be happening in the servers/machines that was already performing bower commands, which has some SSL certificate caching present during the SSL handshake process. For new machines (where bower command is ran for the first time), the issue seems not present

    As a temporary work around, we commented out bower command from the CI/CD process(since we do not have new packages being added at the moment) and retained a copy of the bower_components folder in the server (this is not recommended approach, but had to do this to solve a deployment blocker).

    Need to find a permanant fix next day!

  11. lucasDechenier commented on Apr 24, 2023

    @lucasDechenier

    Hello Guys, any solution for this?

    I Had the same on CircleCI:

    bower invalid-meta for:/root/project/watson2/bower.json
    bower invalid-meta The "name" is recommended to be lowercase, can contain digits, dots, dashes
    bower CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/angular-media-queries failed: certificate has expired

    Exited with code exit status 1
    CircleCI received exit code 1

    In my Steps I run:

    steps:

    • checkout
    • run: npm install -g bower
  12. GabeGates commented on Apr 24, 2023

    @GabeGates

    Same issues here, setting strict-ssl to false has worked as a temp solution. Hope this is resolved soon.

  13. hoggworks commented on Apr 24, 2023

    @hoggworks

    I'm having the same issue in our Jenkins pipeline.

  14. SomeBdyElse commented on Apr 24, 2023

    @SomeBdyElse

    I have the same issue in a CI pipeline. Its an oudated node and bower version

    npm install -g [email protected]
    bower install MutationObserver-shim
    # …
    # bower                 CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/MutationObserver-shim failed: certificate has expired
    

    curl had the same issue:

    curl https://registry.bower.io/packages/MutationObserver-shim
    # curl: (60) SSL certificate problem: certificate has expired
    

    I fixed the issue for curl by removing an invalid itermediary cert:

    sed -i 's/mozilla\/DST_Root_CA_X3.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf
    update-ca-certificates
    
    curl https://registry.bower.io/packages/MutationObserver-shim
    # {"name":"MutationObserver-shim","url":"https://github.com/megawac/MutationObserver.js.git"}

    But bower still has the same issue:

    bower install MutationObserver-shim
    # bower                 CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/MutationObserver-shim failed: certificate has expired
    

    Would it be possible that bower somehow uses a differnt ca-cert folder than curl?

  15. SomeBdyElse commented on Apr 24, 2023

    @SomeBdyElse

    Would it be possible that bower somehow uses a differnt ca-cert folder than curl?

    This seems to be true, but it is fixable:

    export NODE_OPTIONS=--use-openssl-ca
    bower install MutationObserver-shim
    

    and it went just fine.

    So for me the entire fix was:

    sed -i 's/mozilla\/DST_Root_CA_X3.crt/!mozilla\/DST_Root_CA_X3.crt/g' /etc/ca-certificates.conf
    update-ca-certificates
    export NODE_OPTIONS=--use-openssl-ca
    
  16. 11 remaining items

  17. mchrapek commented on Apr 25, 2023

    @mchrapek

    bower install works for newer versions of node.

    Only bower install command I execute on the newer node (for example 12), and the rest of the commands for building the project I execute on the version I need.

    It worked for us.

  18. amanneesharma commented on Apr 26, 2023

    @amanneesharma

    Having the same issue.
    Tried some step as below:

    1. Added "strict-ssl": false to bowerrc file.
    2. Ran bower install.
    3. Delete downloaded bower components.
    4. Removed "strict-ssl": false from bowerrc file.
    5. Ran bower install again.

    Worked for me!!!

  19. amit-oli-khoros commented on Apr 26, 2023

    @amit-oli-khoros

    Other solutions you might try for now are:

    • Put all dependencies in separate git repository somehow and clone them instead of running bower install
    • You can also try to disable ssl (not recommended) in .bowerrc: with { "strict-ssl": false }

    In the meantime I'll work on another solution that should fix this issue by embedding registry within Bower itself.

    Hi @sheerun , Is there any update on the fix that you were working on?

  20. ujjwaldave commented on Apr 26, 2023

    @ujjwaldave

    Other solutions you might try for now are:

    • Put all dependencies in separate git repository somehow and clone them instead of running bower install
    • You can also try to disable ssl (not recommended) in .bowerrc: with { "strict-ssl": false }

    In the meantime I'll work on another solution that should fix this issue by embedding registry within Bower itself.

    Hi @sheerun , Is there any update on the fix that you were working on?

    +1, is there any ETA on this fix.

  21. stormonster commented on Apr 26, 2023

    @stormonster

    As I mentioned here, a temporary solution that solved the issue for us was to use the heroku-mirror rather than the regular registry.

    Rather than turning off SSL we've set the registry parameter in the .bowerrc like this.

    {
      "directory": "bower_components",
      "registry": "https://bower.herokuapp.com",
    }
    

    Not sure how permanent of a solution it is as I've seen it mentioned that certs for node versions <10 are discontinued now, but at least it worked for us and it sure beats turning off SSL.

  22. tfabris commented on Apr 27, 2023

    @tfabris

    I'm trying to keep a legacy app building, one that uses old versions of node and bower. I can't at the moment upgrade either of them. These build on Windows build agent computers. Most of the solutions listed here are for linux build systems, so I can't do any of those.

    We have a couple dozen ".bowerrc" files in the build, and adding some lines to those files is possible. I've seen two possible temporary solutions listed in this thread. Thanks very much to the folks who suggested them. The two choices open to me seem to be to either add this line:

    "strict-ssl": false 

    Or to add this line:

    "registry": "https://bower.herokuapp.com"

    Both seem risky. Can someone please help me understand which one is riskier? Keep in mind that I'm completely inexperienced in Bower, NPM, Ember, and the other technologies that this app is built with (I'm a C# guy normally). The first option, as I understand it, would make it possible for us to retrieve some of our modules from sites with expired SSL certificates, but at least we'd be getting those files from the same places as we did before. I've tried that one and it works as a temporary fix. The second, seems like we'd be changing the place where we get the files from, which to me sounds much riskier.

    Does anyone have an opinion on this?

    Thanks!

  23. mattsputnikdigital commented on Apr 27, 2023

    @mattsputnikdigital

    @tfabris how old is the Ember app? It shouldn't take too much work to remove Bower and get ember-auto-import working which was designed to replace it in v3 of Ember.

    Other options include using Docker to build the app for deploy and setting the version of node to something like "FROM node:14-alpine as ember"

    Using "strict-ssl": false is a working option, disables certs obviously but its probably the quickest option in the short term.

  24. tfabris commented on Apr 27, 2023

    @tfabris

    @mattsputnikdigital thanks for that information. The ember app is years old and the people who knew how to maintain its build system are no longer with the company. Replacing the build system with a new one certainly "sounds" simple but keep in mind that I have no idea how it works, like, at all.

    I'm also thinking that "strict-ssl": false seems like the better option, because I looked at the herokuapp.com cert and it expires next year anyway thus it would just kick the can down the road a bit.

  25. mattsputnikdigital commented on Apr 27, 2023

    @mattsputnikdigital

    @mattsputnikdigital thanks for that information. The ember app is years old and the people who knew how to maintain its build system are no longer with the company. Replacing the build system with a new one certainly "sounds" simple but keep in mind that I have no idea how it works, like, at all.

    I'm also thinking that "strict-ssl": false seems like the better option, because I looked at the herokuapp.com cert and it expires next year anyway thus it would just kick the can down the road a bit.

    Yes if you can accept the risk of the "strict-ssl": false then it would be fine. If you need help with Ember my company manages lots of older Ember sites and could probably get it working without Bower for you if you need assistance.

  26. tfabris commented on Apr 27, 2023

    @tfabris

    @mattsputnikdigital Thanks so much for your help and advice. That's a kind offer to help us out. If we decide to go that route I'll ping you.

  27. azajkhan commented on Apr 28, 2023

    @azajkhan

    Still facing issues
    14:14:32 bower oauth-js#0.4.8
    CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/oauth-js failed: certificate has expired

  28. azajkhan commented on Apr 28, 2023

    @azajkhan

    14:22:14 bower angular-recaptcha#4.2.0 CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/angular-recaptcha failed: certificate has expired

  29. mattsputnikdigital commented on Apr 28, 2023

    @mattsputnikdigital

    14:22:14 bower angular-recaptcha#4.2.0 CERT_HAS_EXPIRED Request to https://registry.bower.io/packages/angular-recaptcha failed: certificate has expired

    You need to either update node to a version which works, I believe over 10 or set "strict-ssl": false I do not think this is going to be fixed otherwise.

  30. GabeGates commented on Apr 29, 2023

    @GabeGates

    Same issues here, setting strict-ssl to false has worked as a temp solution. Hope this is resolved soon.

    Our company was able to get passed this by upgrading to node 18

  31. hma1983 commented on May 10, 2023

    @hma1983

    Ran into the same problem, we are using node 8, can't upgrade to new version either at least for another year.

    I used this silly workaround, switch to node 12 for bower install, then change back to node 8 for gulp build:

    RUN npm install
    RUN npm install n -g
    RUN n 12.22.9
    RUN bower --allow-root install
    RUN n 8.15.1
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions