How to generate and use a SSL certificate in NodeJS

Поділитися
Вставка
  • Опубліковано 1 гру 2024

КОМЕНТАРІ • 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 !

  • @RhynaNI
    @RhynaNI Рік тому +1

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

  • @cheriecheung4164
    @cheriecheung4164 4 роки тому +13

    you're a great teacher!! very clear instruction

  • @asdf14051
    @asdf14051 2 роки тому

    The only one that could explain it properly!

  • @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 😃

  • @rahulsuthar4966
    @rahulsuthar4966 2 роки тому +1

    how did you change your terminal font and color

  • @kennyanthony4319
    @kennyanthony4319 2 роки тому

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

  • @barakerzeonlist4608
    @barakerzeonlist4608 4 роки тому +2

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

  • @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

  • @ParuldotJain
    @ParuldotJain 8 місяців тому

    Best video on ssl. Thanks a lot .

  • @notem1nomedisponivel
    @notem1nomedisponivel Рік тому +1

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

  • @ramiworkstation
    @ramiworkstation 4 місяці тому

    Thank you very much for the nice lesson 💐

  • @oswberta
    @oswberta Рік тому +1

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

  • @arunkutz
    @arunkutz 3 роки тому +1

    Thanks for the video . Very helpful.

  • @vunguyenvan1860
    @vunguyenvan1860 2 роки тому +1

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

  • @StreamOfArunan
    @StreamOfArunan 3 роки тому +2

    Great tutorial! Short and Clear.

  • @ananasjuice7059
    @ananasjuice7059 2 роки тому

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

  • @electrolyteorb
    @electrolyteorb 2 роки тому +1

    Very precise and clear explanation

  • @PriyankRupareliya
    @PriyankRupareliya 3 роки тому +2

    Truly helpful. Thank you for such value !

  • @HW-Kanal
    @HW-Kanal 3 роки тому +2

    It was a great help to me, thank you

  • @hardikraval1585
    @hardikraval1585 2 роки тому +1

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

  • @Zeddted
    @Zeddted Рік тому

    Can this same method be used for development purposes

  • @Fleshlight_Reviewer
    @Fleshlight_Reviewer 4 роки тому +2

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

  • @xiangxiang5833
    @xiangxiang5833 2 роки тому +1

    How to download openssl? I cant use the command openssl

  • @Zeddted
    @Zeddted Рік тому

    Can this procedure be used for production purposes

  • @ashtechcoder989
    @ashtechcoder989 4 роки тому +3

    Amazing content bro😍🔥

  • @algodal433
    @algodal433 Рік тому

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

  • @muditsinghverma
    @muditsinghverma 2 роки тому +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.

  • @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

  • @prageethbhanuka7882
    @prageethbhanuka7882 3 роки тому

    Thanks a lot! This saved me in an assignment!

  • @mustafakosmaz7509
    @mustafakosmaz7509 2 роки тому +1

    you're a man! thanks

  • @AshishSharma-tc2el
    @AshishSharma-tc2el 4 роки тому +6

    Make more content on node js ❤️🔥

  • @yousufzubair1417
    @yousufzubair1417 2 роки тому

    after finding 100s of solution only this one works fine

  • @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

  • @deepakverma-uo7pf
    @deepakverma-uo7pf 4 роки тому +2

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

  • @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

  • @raselhossain8855
    @raselhossain8855 2 роки тому

    Why ssl is need for nodejs development server?

  • @uttkarshsingh3771
    @uttkarshsingh3771 4 роки тому +1

    loved your content bro

  • @rafanteapps1888
    @rafanteapps1888 4 роки тому +1

    Thank you so much! Solved my problem

  • @rajpatel9406
    @rajpatel9406 3 роки тому +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  3 роки тому

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

    • @rajpatel9406
      @rajpatel9406 3 роки тому +1

      Thanks truly helpful

  • @dawid_dahl
    @dawid_dahl 4 роки тому +4

    Perfect, thank you! 🖤

  • @joelchacon9278
    @joelchacon9278 2 роки тому

    good stuff brother!

  • @juliasetiawan9784
    @juliasetiawan9784 2 роки тому

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

  • @ammulutrips4657
    @ammulutrips4657 3 роки тому

    Simple,Crisp and clear

  • @LePhenixGD
    @LePhenixGD 2 роки тому +1

    Great tutorial!

  • @tushaar9027
    @tushaar9027 3 роки тому

    Hi video good ,but can expalin cert generation using letsencrypt

  • @apurvamande7832
    @apurvamande7832 3 роки тому +1

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

  • @parris3142
    @parris3142 Рік тому +1

    well explained

  • @livandy2128
    @livandy2128 2 роки тому +1

    Thank you very much

  • @thefoxguy
    @thefoxguy 3 роки тому +1

    Is it now really encrypted or not?

  • @sonhoangngoc7809
    @sonhoangngoc7809 3 роки тому +1

    thank you!

  • @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

  • @chinmaydeshpande5046
    @chinmaydeshpande5046 2 роки тому +1

    thanks bro

  • @samanthaletourneau9709
    @samanthaletourneau9709 3 роки тому +1

    Thank you !!! =D

  • @mouhannadal-hmedi1501
    @mouhannadal-hmedi1501 Рік тому

    thanks a lot!

  • @yousufkalim
    @yousufkalim 3 роки тому

    Dude which font are you using?

  • @pooriagohari4469
    @pooriagohari4469 3 роки тому +1

    You helped me
    I ask God to help you bro

  • @mohamedyahyacheikhmaazouz1650

    thank you 🙂

  • @ThriveniPrasadBlogsandVlogs
    @ThriveniPrasadBlogsandVlogs 3 роки тому

    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  3 роки тому

      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 3 роки тому

      @@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  3 роки тому

      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.

  • @sushilrai2290
    @sushilrai2290 3 роки тому

    will this work on aws ec2 instance ?

  • @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

  • @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.

  • @vityamv
    @vityamv 3 роки тому

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

    • @mafiacodes
      @mafiacodes  3 роки тому

      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 роки тому

  • @geoffroyulrichkouadio3982
    @geoffroyulrichkouadio3982 3 роки тому +1

    thank you .

  • @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?

  • @PenedoTorneios
    @PenedoTorneios 3 роки тому +1

    TOP!! thank you

  • @macros3798
    @macros3798 4 роки тому +1

    Thank u bro your so good

  • @JNET_Reloaded
    @JNET_Reloaded 2 роки тому

    amazing thanks :D

  • @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

  • @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

  • @udaya129
    @udaya129 4 місяці тому

    Good one

  • @treeworldnight3700
    @treeworldnight3700 Рік тому

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

  • @grandbudha6251
    @grandbudha6251 3 роки тому +1

    PERFECT....

  • @sandboxproto2783
    @sandboxproto2783 2 роки тому

    yes its invalid ssl across all browsers

  • @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!

  • @sambhusbabu
    @sambhusbabu 4 роки тому

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

    • @MrMedzoo
      @MrMedzoo 4 роки тому +2

      UA-cam 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

  • @БорисЮринов-ъ8ъ
    @БорисЮринов-ъ8ъ 3 роки тому

    Thanks alot

  • @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.

  • @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

  • @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?

  • @dronesgranada
    @dronesgranada 3 роки тому

    You saved my ass!

  • @sinchanaa8093
    @sinchanaa8093 7 місяців тому

    How to generate and use SSL certificate in NodeJS

  • @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 роки тому

      ua-cam.com/video/2SzgmTIuHRU/v-deo.html

  • @matchstick_art
    @matchstick_art 4 роки тому

    ERR_INVALID_OPT_VALUE_ENCODING

  • @chayangkoonsuwit
    @chayangkoonsuwit 2 роки тому

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

  • @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

  • @furkansaryldz8494
    @furkansaryldz8494 2 роки тому

    Thanks

  • @upbeyond671
    @upbeyond671 Рік тому +1

    Legend

  • @abdulkadirguven1173
    @abdulkadirguven1173 2 роки тому

    Thank you very much