How to generate and use a SSL certificate in NodeJS

  Рет қаралды 102,059

Mafia Codes

Mafia Codes

3 жыл бұрын

In this video you will learn how to generate a #SSL/#TLS certificates
for development purposes. You will also learn how to use them in a #nodejs #express application.
🚀 Deploy NodeJs app: zeet.co/r/yourstruly
(One FREE project forever 😘)
⭐ Kite is a free AI-powered coding assistant that will help you code faster and smarter. The Kite plugin integrates with all the top editors and IDEs to give you smart completions and documentation while you’re typing. I've been using Kite for 6 months and I love it! www.kite.com/get-kite/?...
FREE $100 credit @Digital Ocean: m.do.co/c/3208f08b3324
Subscribe: kzbin.info...
Support the channel:
Paypal: www.paypal.me/trulymittal
Patreon: / trulymittal
Github (full-tutorial): github.com/trulymittal/ssl-se...
---------------
Other useful Playlists
---------------
#RestAPI (#NodeJS and MongoDB): • REST API using NodeJS ...
#API Authentication using #JWT: • NodeJS API Authenticat...
#Firebase: • Firebase | Build a Not...
Docker: • Docker
MongoDB: • Learn MongoDB in 50 mi...
Html/Css/Js: • HTML / CSS / JS
Android: • Android
Challenges: • Challenges
---------------
What I use
---------------
Mouse: amzn.to/2O9RJtu
Keyboard: amzn.to/2qxajCU
Keyboard 2: amzn.to/2XDWH4X
Monitor: amzn.to/2pDg7dH
Processor: amzn.to/347WWIb
RAM: amzn.to/2QEkUqw
Graphics: amzn.to/33aBrF4
Microphone: amzn.to/2DabdI9
#StayHome #WithMe #yoursTRULY #tutorial #howto #android

Пікірлер: 164
@petrhybler1618
@petrhybler1618 2 жыл бұрын
best tutorial ever !!!! simple, straightforward, and foremost -> working!!! thx boss
@cheriecheung4164
@cheriecheung4164 3 жыл бұрын
you're a great teacher!! very clear instruction
@ammulutrips4657
@ammulutrips4657 2 жыл бұрын
This is very very helpful. Your way of teaching is awesome!! Please make some more videos on Node js. Thanks a lot
@balotz4
@balotz4 9 ай бұрын
Thank you so much, watching your video helped me understand how the certificate works.
@Cricket_TURF
@Cricket_TURF 2 жыл бұрын
The Best ever knowledgeable Nodejs Advanced series i have found to expand my knowlage , Thanks !
@mafiacodes
@mafiacodes 2 жыл бұрын
Glad to hear that!
@StreamOfArunan
@StreamOfArunan 2 жыл бұрын
Great tutorial! Short and Clear.
@kennyanthony4319
@kennyanthony4319 Жыл бұрын
Yes!!! Thank you so much! Explained beautifully! Liked the video! :)
@dawid_dahl
@dawid_dahl 3 жыл бұрын
Perfect, thank you! 🖤
@barakerzeonlist4608
@barakerzeonlist4608 3 жыл бұрын
I love the way you explain it keep it up😍😍
@asdf14051
@asdf14051 2 жыл бұрын
The only one that could explain it properly!
@prageethbhanuka7882
@prageethbhanuka7882 2 жыл бұрын
Thanks a lot! This saved me in an assignment!
@ammulutrips4657
@ammulutrips4657 2 жыл бұрын
Simple,Crisp and clear
@mohitagrawal1555
@mohitagrawal1555 2 жыл бұрын
thank bro. I am stuck in this problem and can't able to find the way out but u solve it in once .
@uttkarshsingh3771
@uttkarshsingh3771 3 жыл бұрын
loved your content bro
@ParuldotJain
@ParuldotJain Ай бұрын
Best video on ssl. Thanks a lot .
@ananasjuice7059
@ananasjuice7059 2 жыл бұрын
Thank you so much! Reaally well explaind an all.. love
@HW-Kanal
@HW-Kanal 3 жыл бұрын
It was a great help to me, thank you
@arunkutz
@arunkutz 2 жыл бұрын
Thanks for the video . Very helpful.
@rafanteapps1888
@rafanteapps1888 3 жыл бұрын
Thank you so much! Solved my problem
@whoaboutyt
@whoaboutyt 2 жыл бұрын
That keyboard . That coding. Omg thx 😃
@Gil-Porsansky-Archive
@Gil-Porsansky-Archive 3 жыл бұрын
thank you for the video !
@algodal433
@algodal433 Жыл бұрын
This is a very good video. Thank you for sharing.
@mohamedyahyacheikhmaazouz1650
@mohamedyahyacheikhmaazouz1650 7 ай бұрын
thank you 🙂
@AshishSharma-tc2el
@AshishSharma-tc2el 3 жыл бұрын
Make more content on node js ❤️🔥
@rapace1370
@rapace1370 2 жыл бұрын
Great video! Can I ask you which VSCode theme / Color Scheme / Font do you use? The code is so readable and beautiful
@codingprojects4002
@codingprojects4002 Жыл бұрын
Font used operator mono
@LePhenixGD
@LePhenixGD 2 жыл бұрын
Great tutorial!
@oswberta
@oswberta 10 ай бұрын
Excellent... realy realy thank you. It's great.
@apurvamande7832
@apurvamande7832 2 жыл бұрын
Perfect explanation. Thank you :) Can we make this certificate as trusted certificate.
@joelchacon9278
@joelchacon9278 Жыл бұрын
good stuff brother!
@ashtechcoder989
@ashtechcoder989 3 жыл бұрын
Amazing content bro😍🔥
@mafiacodes
@mafiacodes 3 жыл бұрын
Thanks 🔥
@PenedoTorneios
@PenedoTorneios 3 жыл бұрын
TOP!! thank you
@onion_____
@onion_____ 3 жыл бұрын
You're a legend tbh. When will you be doing some typescript stuff
@mafiacodes
@mafiacodes 3 жыл бұрын
Soon sometime
@sonhoangngoc7809
@sonhoangngoc7809 2 жыл бұрын
thank you!
@hardikraval1585
@hardikraval1585 Жыл бұрын
Can I ask you which VSCode theme / Color Scheme / Font do you use?
@deepakverma-uo7pf
@deepakverma-uo7pf 3 жыл бұрын
nice sir, you are really jental man and my coach thank u sir 👍
@mafiacodes
@mafiacodes 3 жыл бұрын
So nice of you
@electrolyteorb
@electrolyteorb 2 жыл бұрын
Very precise and clear explanation
@mafiacodes
@mafiacodes 2 жыл бұрын
Subscribe like share
@mouhannadal-hmedi1501
@mouhannadal-hmedi1501 6 ай бұрын
thanks a lot!
@chinmaydeshpande5046
@chinmaydeshpande5046 Жыл бұрын
thanks bro
@parris3142
@parris3142 Жыл бұрын
well explained
@rahulsuthar4966
@rahulsuthar4966 Жыл бұрын
how did you change your terminal font and color
@vunguyenvan1860
@vunguyenvan1860 2 жыл бұрын
thanks for your video, it''s help me so much !
@mafiacodes
@mafiacodes 2 жыл бұрын
Subscribe like share
@geoffroyulrichkouadio3982
@geoffroyulrichkouadio3982 3 жыл бұрын
thank you .
@abdulkadirguven1173
@abdulkadirguven1173 2 жыл бұрын
Thank you very much
@grandbudha6251
@grandbudha6251 3 жыл бұрын
PERFECT....
@Zeddted
@Zeddted Жыл бұрын
Can this procedure be used for production purposes
@muditsinghverma
@muditsinghverma 2 жыл бұрын
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.
@juliasetiawan9784
@juliasetiawan9784 Жыл бұрын
how do you do this in Next JS, at getServersideProps environment? I believe the server is in node JS
@Zeddted
@Zeddted Жыл бұрын
Can this same method be used for development purposes
@yousufzubair1417
@yousufzubair1417 Жыл бұрын
after finding 100s of solution only this one works fine
@rajpatel9406
@rajpatel9406 3 жыл бұрын
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 жыл бұрын
Thanks truly helpful
@mangmang9986
@mangmang9986 11 ай бұрын
I followed the tutorial an it successfull on the backend but I also need https on the frontend that build with react too
@samanthaletourneau9709
@samanthaletourneau9709 2 жыл бұрын
Thank you !!! =D
@mafiacodes
@mafiacodes 2 жыл бұрын
Subscribe like share
@mustafakosmaz7509
@mustafakosmaz7509 Жыл бұрын
you're a man! thanks
@mafiacodes
@mafiacodes Жыл бұрын
Glad it helped!
@user-tv9gk8df1u
@user-tv9gk8df1u 2 жыл бұрын
Thanks alot
@notem1nomedisponivel
@notem1nomedisponivel Жыл бұрын
Thank you so much, works for me. 1000 likes for you
@mafiacodes
@mafiacodes Жыл бұрын
Glad it helped
@macros3798
@macros3798 3 жыл бұрын
Thank u bro your so good
@mafiacodes
@mafiacodes 3 жыл бұрын
Glad I could help
@JNET_Reloaded
@JNET_Reloaded 2 жыл бұрын
amazing thanks :D
@mafiacodes
@mafiacodes 2 жыл бұрын
Subscribe like share
@raselhossain8855
@raselhossain8855 Жыл бұрын
Why ssl is need for nodejs development server?
@tushaar9027
@tushaar9027 2 жыл бұрын
Hi video good ,but can expalin cert generation using letsencrypt
@daxxramas7974
@daxxramas7974 2 жыл бұрын
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 2 жыл бұрын
It won’t be a problem you can use the method as described in this video
@daxxramas7974
@daxxramas7974 2 жыл бұрын
@@mafiacodes thanks a lot i will give it a try tonight
@xiangxiang5833
@xiangxiang5833 Жыл бұрын
How to download openssl? I cant use the command openssl
@rajataggarwal4780
@rajataggarwal4780 3 жыл бұрын
The file key.pem contains both public as well as the private key or only the private key?
@mafiacodes
@mafiacodes 3 жыл бұрын
private key only @ 5:34
@rajataggarwal4780
@rajataggarwal4780 3 жыл бұрын
@@mafiacodes Ok thanks. Where can I find corresponding public key?
@mafiacodes
@mafiacodes 3 жыл бұрын
U need to generate one
@rajataggarwal4780
@rajataggarwal4780 3 жыл бұрын
@@mafiacodes key.pem contains a key pair. Refrence: stackoverflow.com/questions/44474516/how-to-create-public-and-private-key-with-openssl
@mafiacodes
@mafiacodes 3 жыл бұрын
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
@pooriagohari4469
@pooriagohari4469 3 жыл бұрын
You helped me I ask God to help you bro
@mafiacodes
@mafiacodes 3 жыл бұрын
Thank u a ton
@sushilrai2290
@sushilrai2290 3 жыл бұрын
will this work on aws ec2 instance ?
@mafiacodes
@mafiacodes 3 жыл бұрын
It will
@yousufkalim
@yousufkalim 3 жыл бұрын
Dude which font are you using?
@mafiacodes
@mafiacodes 3 жыл бұрын
operator mono
@blunygeorge
@blunygeorge 2 жыл бұрын
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 2 жыл бұрын
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.
@rajeevchris4920
@rajeevchris4920 3 жыл бұрын
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 3 жыл бұрын
What is the context of ur question - I don’t get it bro
@rajeevchris4920
@rajeevchris4920 3 жыл бұрын
@@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 3 жыл бұрын
Coz the link might not refer to the image - share the link of image which ur using
@rajeevchris4920
@rajeevchris4920 3 жыл бұрын
@@mafiacodes mittal please answer images.app.goo.gl/3ur8QkdGY81uzHzx5 this is the link mittal please answer
@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 жыл бұрын
@Switch620
@Switch620 7 ай бұрын
self signed certs suck though!
@dronesgranada
@dronesgranada 2 жыл бұрын
You saved my ass!
@Virus-ke8xj
@Virus-ke8xj 3 жыл бұрын
The value "/cert.pem" is invalid for option "encoding", what do I do in this case, PLEASE HELP ME!!!
@mafiacodes
@mafiacodes 3 жыл бұрын
Follow the steps again, probably u r using the wrong certificate, if still gives error revert back
@sambhusbabu
@sambhusbabu 3 жыл бұрын
Do you know how the KZbin stream video in different qualities (240p, 360p,...) For android app. Can you help me to build KZbin like video streaming app with video quality control.
@MrMedzoo
@MrMedzoo 3 жыл бұрын
KZbin 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 3 жыл бұрын
💯
@sambhusbabu
@sambhusbabu 3 жыл бұрын
@@MrMedzoo thanks
@treeworldnight3700
@treeworldnight3700 9 ай бұрын
How can I write rocket on console.log like thatt^o^?, thanks you
@mafiacodes
@mafiacodes 9 ай бұрын
Just a simple emoji
@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
@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?
@mafiacodes
@mafiacodes 3 жыл бұрын
yup it is...
@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.
@sandboxproto2783
@sandboxproto2783 2 жыл бұрын
yes its invalid ssl across all browsers
@thatonefoxxy
@thatonefoxxy 3 жыл бұрын
Is it now really encrypted or not?
@mafiacodes
@mafiacodes 3 жыл бұрын
Yes it is,
@anaskhalilkhalilahmed3586
@anaskhalilkhalilahmed3586 3 жыл бұрын
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 3 жыл бұрын
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.
@thesrinathkamath
@thesrinathkamath 2 жыл бұрын
how to listen to ssl renewal and serve automatically?
@mafiacodes
@mafiacodes 2 жыл бұрын
This is a manually generated ssl, so u need to do a cron job and then issue the command again
@thesrinathkamath
@thesrinathkamath 2 жыл бұрын
@@mafiacodes But can't it be handled inside the node-server? with SNICallbacks? or TLS
@mafiacodes
@mafiacodes 2 жыл бұрын
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 2 жыл бұрын
@@mafiacodes Thanx bro!
@lionetbom8209
@lionetbom8209 3 жыл бұрын
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 3 жыл бұрын
Share code on GitHub
@lionetbom8209
@lionetbom8209 3 жыл бұрын
@@mafiacodes Hi, this github.com/sergiopj/photo-translator-backend thank you for all!!
@mafiacodes
@mafiacodes 3 жыл бұрын
Most likely issue with Firefox, seems ur using that? Try chrome
@lionetbom8209
@lionetbom8209 3 жыл бұрын
@@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!
@damiangilz
@damiangilz 3 жыл бұрын
If an error page shows, just click anywhere in the page and you can also type "thisissecure" without the " and the page then loads.
@jampackedjames
@jampackedjames 3 жыл бұрын
I followed your instructions and Chrome gave me: Your connection is not private NET::ERR_CERT_INVALID
@mafiacodes
@mafiacodes 3 жыл бұрын
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 2 жыл бұрын
@@mafiacodes I am also getting this error but not getting response message: "Hello from ssl server". How to fix it?
@tambolaking5383
@tambolaking5383 3 жыл бұрын
You get free certificate from aws
@mafiacodes
@mafiacodes 3 жыл бұрын
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
@sinchanaa8093
@sinchanaa8093 17 күн бұрын
How to generate and use SSL certificate in NodeJS
@matchstick_art
@matchstick_art 3 жыл бұрын
ERR_INVALID_OPT_VALUE_ENCODING
@mafiacodes
@mafiacodes 3 жыл бұрын
On which command?
@jeremyh9841
@jeremyh9841 2 жыл бұрын
you should show how to make a certificate from an authority because this example is useless in production
@mafiacodes
@mafiacodes 2 жыл бұрын
kzbin.info/www/bejne/aITdmKCKftp7iLc
@chayangkoonsuwit
@chayangkoonsuwit Жыл бұрын
ฉันเป็นไทย และตอนเวลาประมาณ 4:00 ฉันอ่านคำบรรยายไม่ทันเลย😅
@anurag9110
@anurag9110 3 жыл бұрын
too much typing sound.
@furkansaryldz8494
@furkansaryldz8494 Жыл бұрын
Thanks
@upbeyond671
@upbeyond671 10 ай бұрын
Legend
@CaptainChubbyDuck
@CaptainChubbyDuck Жыл бұрын
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
@livandy2128
@livandy2128 2 жыл бұрын
Thank you very much
@mafiacodes
@mafiacodes 2 жыл бұрын
Subscribe like share
Full Node.js Deployment - NGINX, SSL With Lets Encrypt
23:48
Traversy Media
Рет қаралды 396 М.
I Trapped Myself in a Box with Colored Smoke!
00:50
A4
Рет қаралды 18 МЛН
ISSEI funny story 😂😂😂Strange World 🌏 Green
00:27
ISSEI / いっせい
Рет қаралды 87 МЛН
Что будет с кроссовком?
00:35
Аришнев
Рет қаралды 1,9 МЛН
How to create a valid self signed SSL Certificate?
25:01
Christian Lempa
Рет қаралды 325 М.
Learn how to do caching in NodeJS using Redis
24:34
Mafia Codes
Рет қаралды 32 М.
HTTPS, SSL, TLS & Certificate Authority Explained
43:29
Laith Academy
Рет қаралды 40 М.
Big Tech AI Is A Lie
16:56
Tina Huang
Рет қаралды 49 М.
Quick and Easy Local SSL Certificates for Your Homelab!
12:08
Wolfgang's Channel
Рет қаралды 640 М.
These Coding Projects Give You An Unfair Advantage
14:39
Harkirat Singh
Рет қаралды 286 М.
SSL, TLS, HTTPS Explained
5:54
ByteByteGo
Рет қаралды 636 М.
programming projects that taught me how to code
9:49
isak
Рет қаралды 199 М.
How To Use TypeScript With Express & Node
17:05
Colt Steele
Рет қаралды 60 М.
I Trapped Myself in a Box with Colored Smoke!
00:50
A4
Рет қаралды 18 МЛН