How to generate and use a SSL certificate in NodeJS

Поделиться
HTML-код
  • Опубликовано: 18 янв 2025

Комментарии • 166

  • @petrhybler1618
    @petrhybler1618 3 года назад +5

    best tutorial ever !!!! simple, straightforward, and foremost -> working!!! thx boss

  • @Cricket_TURF
    @Cricket_TURF 3 года назад +4

    The Best ever knowledgeable Nodejs Advanced series i have found to expand my knowlage , Thanks !

  • @cheriecheung4164
    @cheriecheung4164 4 года назад +13

    you're a great teacher!! very clear instruction

  • @RhynaNI
    @RhynaNI Год назад +1

    Thank you so much, watching your video helped me understand how the certificate works.

  • @asdf14051
    @asdf14051 2 года назад

    The only one that could explain it properly!

  • @rahulsuthar4966
    @rahulsuthar4966 2 года назад +1

    how did you change your terminal font and color

  • @mohitagrawal1555
    @mohitagrawal1555 3 года назад +1

    thank bro. I am stuck in this problem and can't able to find the way out but u solve it in once .

  • @whoaboutyt
    @whoaboutyt 3 года назад +1

    That keyboard . That coding. Omg thx 😃

  • @ParuldotJain
    @ParuldotJain 9 месяцев назад

    Best video on ssl. Thanks a lot .

  • @barakerzeonlist4608
    @barakerzeonlist4608 4 года назад +2

    I love the way you explain it keep it up😍😍

  • @StreamOfArunan
    @StreamOfArunan 3 года назад +2

    Great tutorial! Short and Clear.

  • @electrolyteorb
    @electrolyteorb 3 года назад +1

    Very precise and clear explanation

  • @dawid_dahl
    @dawid_dahl 4 года назад +4

    Perfect, thank you! 🖤

  • @HW-Kanal
    @HW-Kanal 3 года назад +2

    It was a great help to me, thank you

  • @oswberta
    @oswberta Год назад +1

    Excellent... realy realy thank you. It's great.

  • @PriyankRupareliya
    @PriyankRupareliya 3 года назад +2

    Truly helpful. Thank you for such value !

  • @ammulutrips4657
    @ammulutrips4657 3 года назад +2

    This is very very helpful. Your way of teaching is awesome!! Please make some more videos on Node js. Thanks a lot

  • @arunkutz
    @arunkutz 3 года назад +1

    Thanks for the video . Very helpful.

  • @ramiworkstation
    @ramiworkstation 6 месяцев назад

    Thank you very much for the nice lesson 💐

  • @AshishSharma-tc2el
    @AshishSharma-tc2el 4 года назад +6

    Make more content on node js ❤️🔥

  • @vunguyenvan1860
    @vunguyenvan1860 3 года назад +1

    thanks for your video, it''s help me so much !

  • @kennyanthony4319
    @kennyanthony4319 2 года назад

    Yes!!! Thank you so much! Explained beautifully! Liked the video! :)

  • @uttkarshsingh3771
    @uttkarshsingh3771 4 года назад +1

    loved your content bro

  • @ananasjuice7059
    @ananasjuice7059 2 года назад

    Thank you so much! Reaally well explaind an all.. love

  • @notem1nomedisponivel
    @notem1nomedisponivel 2 года назад +1

    Thank you so much, works for me. 1000 likes for you

  • @ashtechcoder989
    @ashtechcoder989 4 года назад +3

    Amazing content bro😍🔥

  • @rafanteapps1888
    @rafanteapps1888 4 года назад +1

    Thank you so much! Solved my problem

  • @Fleshlight_Reviewer
    @Fleshlight_Reviewer 4 года назад +2

    You're a legend tbh. When will you be doing some typescript stuff

  • @LePhenixGD
    @LePhenixGD 2 года назад +1

    Great tutorial!

  • @livandy2128
    @livandy2128 3 года назад +1

    Thank you very much

  • @sonhoangngoc7809
    @sonhoangngoc7809 3 года назад +1

    thank you!

  • @ammulutrips4657
    @ammulutrips4657 3 года назад

    Simple,Crisp and clear

  • @chinmaydeshpande5046
    @chinmaydeshpande5046 2 года назад +1

    thanks bro

  • @parris3142
    @parris3142 Год назад +1

    well explained

  • @mustafakosmaz7509
    @mustafakosmaz7509 2 года назад +1

    you're a man! thanks

  • @prageethbhanuka7882
    @prageethbhanuka7882 3 года назад

    Thanks a lot! This saved me in an assignment!

  • @mohamedyahyacheikhmaazouz1650
    @mohamedyahyacheikhmaazouz1650 Год назад

    thank you 🙂

  • @rapace1370
    @rapace1370 3 года назад +4

    Great video! Can I ask you which VSCode theme / Color Scheme / Font do you use? The code is so readable and beautiful

  • @deepakverma-uo7pf
    @deepakverma-uo7pf 4 года назад +2

    nice sir, you are really jental man and my coach
    thank u sir 👍

  • @mouhannadal-hmedi1501
    @mouhannadal-hmedi1501 Год назад

    thanks a lot!

  • @geoffroyulrichkouadio3982
    @geoffroyulrichkouadio3982 3 года назад +1

    thank you .

  • @MTH_MUST_OBEY
    @MTH_MUST_OBEY Год назад

    Can this procedure be used for production purposes

  • @xiangxiang5833
    @xiangxiang5833 2 года назад +1

    How to download openssl? I cant use the command openssl

  • @MTH_MUST_OBEY
    @MTH_MUST_OBEY Год назад

    Can this same method be used for development purposes

  • @algodal433
    @algodal433 Год назад

    This is a very good video. Thank you for sharing.

  • @joelchacon9278
    @joelchacon9278 2 года назад

    good stuff brother!

  • @hardikraval1585
    @hardikraval1585 2 года назад +1

    Can I ask you which VSCode theme / Color Scheme / Font do you use?

  • @PenedoTorneios
    @PenedoTorneios 3 года назад +1

    TOP!! thank you

  • @samanthaletourneau9709
    @samanthaletourneau9709 3 года назад +1

    Thank you !!! =D

  • @daxxramas7974
    @daxxramas7974 3 года назад +1

    Hello sir, I am working on a school project for an Android application. For the backend side of things, I created an express rest api (it does not serve any Web page). I am looking for a way to secure communications between m'y Android app and my express server with an ssl certificate. Would self signed certificates be a problem for this use case ? Since I do not need to access the api through a Web browser, i'm guessing i Would never see this browser warning for invalid certificate right ? Do i need to apply further workaround for communication between my Android app and the server, or between postman and the server ?
    I have not tried your method as of yet, but thank you for your clear explanation, it seems so simple and straight forward thanks to you. Cheers

    • @mafiacodes
      @mafiacodes  3 года назад

      It won’t be a problem you can use the method as described in this video

    • @daxxramas7974
      @daxxramas7974 3 года назад

      @@mafiacodes thanks a lot i will give it a try tonight

  • @raselhossain8855
    @raselhossain8855 2 года назад

    Why ssl is need for nodejs development server?

  • @БорисЮринов-ъ8ъ
    @БорисЮринов-ъ8ъ 3 года назад

    Thanks alot

  • @muditsinghverma
    @muditsinghverma 3 года назад +1

    Great Tutorial..
    SSL certificates expire after a certain time period like 90 days for Let's Encrypt and generate fresh certificates using AutoSSL or upon renewal. Updating the options variable and restarting the server is a pain in such case. How to update the Node.js app to automatically retrieve valid certificate files from given directories, removing needs to replace hard-coded paths and reboot.

  • @JNET_Reloaded
    @JNET_Reloaded 3 года назад

    amazing thanks :D

  • @rajpatel9406
    @rajpatel9406 4 года назад +1

    Hey man just watched your video and subscribed it,but how do we install openssl on windows 10 for keys and certificates you did looking for your answers

    • @mafiacodes
      @mafiacodes  4 года назад

      This would be helpful stackoverflow.com/questions/50625283/how-to-install-openssl-in-windows-10

    • @rajpatel9406
      @rajpatel9406 4 года назад +1

      Thanks truly helpful

  • @yousufzubair1417
    @yousufzubair1417 2 года назад

    after finding 100s of solution only this one works fine

  • @juliasetiawan9784
    @juliasetiawan9784 2 года назад

    how do you do this in Next JS, at getServersideProps environment? I believe the server is in node JS

  • @rajataggarwal4780
    @rajataggarwal4780 4 года назад +1

    The file key.pem contains both public as well as the private key or only the private key?

    • @mafiacodes
      @mafiacodes  4 года назад

      private key only @ 5:34

    • @rajataggarwal4780
      @rajataggarwal4780 4 года назад

      @@mafiacodes Ok thanks. Where can I find corresponding public key?

    • @mafiacodes
      @mafiacodes  4 года назад

      U need to generate one

    • @rajataggarwal4780
      @rajataggarwal4780 4 года назад

      @@mafiacodes key.pem contains a key pair. Refrence: stackoverflow.com/questions/44474516/how-to-create-public-and-private-key-with-openssl

    • @mafiacodes
      @mafiacodes  4 года назад +1

      Refer this article for more detailed explanation of what’s going on www.devco.net/archives/2006/02/13/public_-_private_key_encryption_using_openssl.php

  • @apurvamande7832
    @apurvamande7832 3 года назад +1

    Perfect explanation. Thank you :) Can we make this certificate as trusted certificate.

  • @pooriagohari4469
    @pooriagohari4469 4 года назад +1

    You helped me
    I ask God to help you bro

  • @grandbudha6251
    @grandbudha6251 3 года назад +1

    PERFECT....

  • @udaya129
    @udaya129 6 месяцев назад

    Good one

  • @macros3798
    @macros3798 4 года назад +1

    Thank u bro your so good

  • @thefoxguy
    @thefoxguy 4 года назад +1

    Is it now really encrypted or not?

  • @mangmang9986
    @mangmang9986 Год назад

    I followed the tutorial an it successfull on the backend but I also need https on the frontend that build with react too

  • @ThriveniPrasadBlogsandVlogs
    @ThriveniPrasadBlogsandVlogs 4 года назад

    Hi I need help I have downloaded certificate and key from GoDaddy but I don't have how to integrate it in nodejs

    • @mafiacodes
      @mafiacodes  4 года назад

      U can use those cert files the same way we have used our own generated files...just simple replace it with ur own downloaded files...

    • @ThriveniPrasadBlogsandVlogs
      @ThriveniPrasadBlogsandVlogs 4 года назад

      @@mafiacodes but I got the certificates like 2 security certificates,1pem file,1key file and 1more request certificate file I have confusion in this which one need use place of cert please any solution you have share me

    • @mafiacodes
      @mafiacodes  4 года назад

      Certificate is most likely the pem file, private key is the key file and other file is just a certificate signing request, so use the pem as certificate and key as private key. Do let me know if all works fine.

  • @vityamv
    @vityamv 4 года назад

    how do you manage to write openssl in visual studio code terminal?

    • @mafiacodes
      @mafiacodes  4 года назад

      It’s simply a terminal inside vscode, the same terminal which we use without vscode, or I am not able to understand what exactly u mean?

    • @sushilrai2290
      @sushilrai2290 3 года назад

      openssl is already installed in mac, u need to install it in win 10 and linux.... is what I heard

    • @Iconejey
      @Iconejey 3 года назад

      @@sushilrai2290 Most UNIX OSs like MacOS and Linux already have openssl integrated.

    • @mafiacodes
      @mafiacodes  3 года назад

  • @rajeevchris4920
    @rajeevchris4920 4 года назад +1

    hi yesterday i asked a doubt about shopping cart project i rectified it and it tried to change the image of the iphone to another image it executed but it did not display any change and the area was blank so can you tell me want is the criteria for and image what format should it use and how much size it should be thanks for answering yesterday and now in advace :) if want more details i will contact you through email :)

    • @mafiacodes
      @mafiacodes  4 года назад

      What is the context of ur question - I don’t get it bro

    • @rajeevchris4920
      @rajeevchris4920 4 года назад

      @@mafiacodes i tried to change the image of the iphone in the shopping crt project so i copied a link from goolge and pasted it in the requied place but after running the application the area was blak why it is blank

    • @mafiacodes
      @mafiacodes  4 года назад

      Coz the link might not refer to the image - share the link of image which ur using

    • @rajeevchris4920
      @rajeevchris4920 4 года назад

      @@mafiacodes mittal please answer images.app.goo.gl/3ur8QkdGY81uzHzx5 this is the link mittal please answer

  • @yousufkalim
    @yousufkalim 3 года назад

    Dude which font are you using?

  • @sushilrai2290
    @sushilrai2290 3 года назад

    will this work on aws ec2 instance ?

  • @blunygeorge
    @blunygeorge 3 года назад

    Is there a disadvantage of using this local certificate other than the browser not trusting it?
    For context:
    Let's say there is a website that would be only be used by a small number of people and they know what is going on the server side and so they have no problem trusting that certificate. In this case, it would be fine to use that right? Now that I wrote this down I remembered that somehow custom certificates can be added to the browser to be trusted, to handle that as an exception of unknown authors. I think there is something like that.

    • @mafiacodes
      @mafiacodes  3 года назад +1

      It is a absolutely 100% fine using this certificate for the use case you defined. And as far as trusting goes may be u can add this as a trusted certificate as u mentioned but I am unaware of it.

  • @tushaar9027
    @tushaar9027 3 года назад

    Hi video good ,but can expalin cert generation using letsencrypt

  • @furkansaryldz8494
    @furkansaryldz8494 2 года назад

    Thanks

  • @nirajlonkar
    @nirajlonkar 3 года назад

    How to deploy this on heroku?

    • @mafiacodes
      @mafiacodes  3 года назад

      use Zeet: zeet.co/r/yourstruly

  • @HW-Kanal
    @HW-Kanal 3 года назад

    If I use websocket now, is this also safe?

  • @Switch620
    @Switch620 Год назад

    self signed certs suck though!

  • @muditjain7994
    @muditjain7994 3 года назад

    Did everything as you said, but getting certificate invalid in my browser. Found the error due to self signed certificate. How to add ca signed certificate?

    • @mafiacodes
      @mafiacodes  3 года назад

      you need to have a valid domain, use that domain to get a free certificate for a CA, like let's encrypt for free certificates or any other paid CA.

    • @muditjain7994
      @muditjain7994 3 года назад

      @@mafiacodes bro localhost pe project bnaya hai aur hame bol rhe hain ki http ko https me transform kro.. Without domain kaise krein

  • @thesrinathkamath
    @thesrinathkamath 3 года назад

    how to listen to ssl renewal and serve automatically?

    • @mafiacodes
      @mafiacodes  3 года назад

      This is a manually generated ssl, so u need to do a cron job and then issue the command again

    • @thesrinathkamath
      @thesrinathkamath 3 года назад

      @@mafiacodes But can't it be handled inside the node-server? with SNICallbacks?
      or TLS

    • @mafiacodes
      @mafiacodes  3 года назад +1

      It can be done but since it’s a development certificate so you can generate it for as long as you want even 10years or even more, for a production SSL you should get a certificate from a certificate authority and then definitely you can handle auto renewals using the said callbacks or even create a cron for the same.

    • @thesrinathkamath
      @thesrinathkamath 3 года назад

      @@mafiacodes Thanx bro!

  • @lionetbom8209
    @lionetbom8209 4 года назад

    Hello good Morning
    The following error is happening to me with the app started and when trying to access from the web browser
    An error occurred connecting to localhost: 3000. You cannot communicate securely with the other party - there are no common encryption algorithms.
    Error code: SSL_ERROR_NO_CYPHER_OVERLAP

    • @mafiacodes
      @mafiacodes  4 года назад +1

      Share code on GitHub

    • @lionetbom8209
      @lionetbom8209 4 года назад

      @@mafiacodes Hi, this github.com/sergiopj/photo-translator-backend
      thank you for all!!

    • @mafiacodes
      @mafiacodes  4 года назад +1

      Most likely issue with Firefox, seems ur using that?
      Try chrome

    • @lionetbom8209
      @lionetbom8209 4 года назад

      @@mafiacodes If the following happens to me with chrome:
      ERR_SSL_VERSION_OR_CIPHER_MISMATCH
      Protocol not supported
      The client and the server do not support the same version of SSL or encryption protocol.
      Thank you for all!

  • @Virus-ke8xj
    @Virus-ke8xj 4 года назад

    The value "/cert.pem" is invalid for option "encoding",
    what do I do in this case, PLEASE HELP ME!!!

    • @mafiacodes
      @mafiacodes  4 года назад

      Follow the steps again, probably u r using the wrong certificate, if still gives error revert back

  • @treeworldnight3700
    @treeworldnight3700 Год назад

    How can I write rocket on console.log like thatt^o^?, thanks you

  • @sandboxproto2783
    @sandboxproto2783 2 года назад

    yes its invalid ssl across all browsers

  • @sambhusbabu
    @sambhusbabu 4 года назад

    Do you know how the RUclips stream video in different qualities (240p, 360p,...) For android app. Can you help me to build RUclips like video streaming app with video quality control.

    • @MrMedzoo
      @MrMedzoo 4 года назад +2

      RUclips use Media source API to do this and is quite difficult to implement, instead you use some protocole which do the hard work for you on server side like hls, hds, dash and for the client android have already implement these protocol so you just need to use exoplayer api

    • @mafiacodes
      @mafiacodes  4 года назад

      💯

    • @sambhusbabu
      @sambhusbabu 4 года назад

      @@MrMedzoo thanks

  • @anaskhalilkhalilahmed3586
    @anaskhalilkhalilahmed3586 4 года назад

    sir this is not a valid certificate i works on service workers which only works in https context i do a same as u do but same the errors comes https requires for service workers so sir how to install a valid ssl certificate for node js local development purpose

    • @mafiacodes
      @mafiacodes  4 года назад

      It’s 💯% valid certificate, it’s only that chrome or other browser does not recognise the certificate authority. You can use it for Dev purposes.

  • @jampackedjames
    @jampackedjames 4 года назад

    I followed your instructions and Chrome gave me: Your connection is not private
    NET::ERR_CERT_INVALID

    • @mafiacodes
      @mafiacodes  4 года назад

      I think u haven’t watched the full video till the end, since I explained this thing that THIS IS FALSE POSITIVE, since u r a certificate authority and chrome does not know that that’s why ur getting this error but cert is 💯% valid, should be used for developing

    • @subhadipsur7561
      @subhadipsur7561 3 года назад

      @@mafiacodes I am also getting this error but not getting response message: "Hello from ssl server". How to fix it?

  • @tambolaking5383
    @tambolaking5383 4 года назад

    You get free certificate from aws

    • @mafiacodes
      @mafiacodes  4 года назад +1

      Well u can get it from let’s encrypt also BUT the point is u need to provide a domain there, and in development u might not have a domain

  • @chayangkoonsuwit
    @chayangkoonsuwit 2 года назад

    ฉันเป็นไทย และตอนเวลาประมาณ 4:00 ฉันอ่านคำบรรยายไม่ทันเลย😅

  • @sinchanaa8093
    @sinchanaa8093 9 месяцев назад

    How to generate and use SSL certificate in NodeJS

  • @dronesgranada
    @dronesgranada 3 года назад

    You saved my ass!

  • @damiangilz
    @damiangilz 4 года назад

    If an error page shows, just click anywhere in the page and you can also type "thisissecure" without the " and the page then loads.

  • @jeremyh9841
    @jeremyh9841 2 года назад

    you should show how to make a certificate from an authority because this example is useless in production

    • @mafiacodes
      @mafiacodes  2 года назад

      ruclips.net/video/2SzgmTIuHRU/видео.html

  • @matchstick_art
    @matchstick_art 4 года назад

    ERR_INVALID_OPT_VALUE_ENCODING

  • @anurag9110
    @anurag9110 3 года назад

    too much typing sound.

  • @CaptainChubbyDuck
    @CaptainChubbyDuck 2 года назад

    Hi when Im writing openssl x509 -req -days 365 -in -csr.pem -signkey key.pem -out cert.pem noting happens, the terminal just prints out "Use -help for summary". What am I missing?
    When I did the previous command of req it said it couldnjt find a file openssl.conf
    Can you please help?
    Thanks

    • @StdDev99
      @StdDev99 Год назад

      Probably because of "-csr.pem" ? The hyphen makes it look like an option and not a value

  • @upbeyond671
    @upbeyond671 Год назад +1

    Legend

  • @abdulkadirguven1173
    @abdulkadirguven1173 2 года назад

    Thank you very much