OpenSSL Step By Step Tutorial | How to Generate Keys, Certificates & CSR Using OpenSSL

Sdílet
Vložit
  • čas přidán 29. 08. 2024
  • OpenSSL step by step tutorial explaining how to generate key pair, how to export public key using openssl commands, how to create CSR using openSSL and how to generate self signed certificate using Open SSL command line tool.
    To dowload openSSL visit: www.openssl.org/
    To learn how to use Java Key Tool to generate self signed certificates: • How to Generate Key St...
    To learn how to use Portecle to generate self signed certificates: • Generate Self Signed C...
    To learn difference between one-way and two-way SSL: • How One Way and Two Wa...

Komentáře • 169

  • @lorenzomagni9200
    @lorenzomagni9200 Před 3 lety +4

    wow everything worked so flawlessly, you're a hero

  • @michaelareay1037
    @michaelareay1037 Před 3 lety +11

    Good job done. Very clearly explained and everything was right to the point and it held my attention. Everyone should do their training videos like this.

  • @azontoboynate
    @azontoboynate Před rokem +2

    Lot's of CSR videos but this one was perfect! Thank you!

  • @TheL337trance
    @TheL337trance Před 2 lety +5

    I needed someone to explain it like this for so long. Thank you man.

  • @raufmedappil
    @raufmedappil Před 3 lety +3

    Thanks a lot bro..I was looking for a simple but explanatory tutorial on how certificates work..this video helped me to understand a lot

  • @BirdFinder100
    @BirdFinder100 Před 3 lety +7

    Excellent demonstration sir. Thank you for making this clear to me.

  • @sachinmarawar7617
    @sachinmarawar7617 Před rokem

    Very well demonstrated key-pair generation, extracting public key, CSR and self-signed certificate. Great work!

  • @florinbujoreanu1020
    @florinbujoreanu1020 Před 27 dny

    BRAVO! thank you for the clear and practical explanation!

  • @morningmotivation4745
    @morningmotivation4745 Před 11 měsíci

    It cleared all my doubts..nicely explained..thanks for the amazing video..!

  • @rfrancoi
    @rfrancoi Před 9 měsíci +1

    Excellent video Sir. Thank you; it is greatly appreciated.

  • @bobbiecorner
    @bobbiecorner Před 2 lety

    Great video ... I was confused before watching this, now I understand much better. Thanks.

  • @shanrk2972
    @shanrk2972 Před 3 lety +1

    Short video, simple to understand. WOW!!! Thank you

  • @mwitschi69
    @mwitschi69 Před 3 lety +1

    Just created my first key, ever. Now going to implement this....

  • @User-nq9ee
    @User-nq9ee Před 3 lety +2

    all those who are having error like me
    The only thing that worked for me in this situation was the self-created openssl.cnf file.
    Here are the basics needed for this exercise (edit as needed):
    #
    # OpenSSL configuration file.
    #
    # Establish working directory.
    @/c:\Users\User\Desktop\test
    dir = .
    [ ca ]
    default_ca = CA_default
    [ CA_default ]
    serial = $dir/serial
    database = $dir/certindex.txt
    new_certs_dir = $dir/certs
    certificate = $dir/cacert.pem
    private_key = $dir/private/cakey.pem
    default_days = 365
    default_md = md5
    preserve = no
    email_in_dn = no
    nameopt = default_ca
    certopt = default_ca
    policy = policy_match
    [ policy_match ]
    countryName = match
    stateOrProvinceName = match
    organizationName = match
    organizationalUnitName = optional
    commonName = supplied
    emailAddress = optional
    [ req ]
    default_bits = 1024 # Size of keys
    default_keyfile = key.pem # name of generated keys
    default_md = md5 # message digest algorithm
    string_mask = nombstr # permitted characters
    distinguished_name = req_distinguished_name
    req_extensions = v3_req
    [ req_distinguished_name ]
    # Variable name Prompt string
    #------------------------- ----------------------------------
    0.organizationName = Organization Name (company)
    organizationalUnitName = Organizational Unit Name (department, division)
    emailAddress = Email Address
    emailAddress_max = 40
    localityName = Locality Name (city, district)
    stateOrProvinceName = State or Province Name (full name)
    countryName = Country Name (2 letter code)
    countryName_min = 2
    countryName_max = 2
    commonName = Common Name (hostname, IP, or your name)
    commonName_max = 64
    # Default values for the above, for consistency and less typing.
    # Variable name Value
    #------------------------ ------------------------------
    0.organizationName_default = My Company
    localityName_default = My Town
    stateOrProvinceName_default = State or Providence
    countryName_default = US
    [ v3_ca ]
    basicConstraints = CA:TRUE
    subjectKeyIdentifier = hash
    authorityKeyIdentifier = keyid:always,issuer:always
    [ v3_req ]
    basicConstraints = CA:FALSE
    subjectKeyIdentifier = hash
    # copy till here
    now save this file and run the command as
    openssl req -new -key tutorialspedia.key -out tutorialspedia.csr -config openssl.cnf
    hope this will work for you :)

  • @ImranKhanVlogs8010
    @ImranKhanVlogs8010 Před 2 lety +1

    Awesome. This is what I needed this morning.

  • @dancewitharun
    @dancewitharun Před 3 lety +1

    Clear explanation to the point. Thanks buddy. Keep uploading more videos like this.

  • @ad1450
    @ad1450 Před 3 lety

    Thanks a lot .Love from India

  • @ankursingh7505
    @ankursingh7505 Před rokem +1

    Great Video, Very clearly explained about CA, CSR.
    I have a question:
    When we are opening the //https connection using self signed CA certificate getting some warnings on //https web page. May I know the reason?
    Kindly, respond.
    Thanks

    • @TutorialsPediaVideos
      @TutorialsPediaVideos  Před rokem

      Dear Ankur,
      Thanks for the kind feedback.
      In case of a self-signed certificate, we get SSL warning because chain of trust is not identified by the browser. Browser trusts only CA signed certificates (unless you explicitly add your certificate in the trust store).
      I will recommend you to watch my other video where I explained SSL chain of trust in much detail.

  • @mazbahurrahman6787
    @mazbahurrahman6787 Před 3 lety

    Worked for me, best video on openssl

  • @LaeeqKhan01
    @LaeeqKhan01 Před 2 lety

    Very nice job.
    Please add info on how to create "non-self-signed certificates". Meaning certificate verifying some other public key. Thanks

  • @ravikalkote1729
    @ravikalkote1729 Před 2 lety

    Great video.. all commands worked for me...thanks...one query how to add critical extensions using your commands?

  • @gadhoodhle
    @gadhoodhle Před 2 lety

    Very useful - clear and consise. Thanks for sharing.

  • @pabloandrade339
    @pabloandrade339 Před 3 lety +12

    The video is good but you have a major mistake. I think the video is using the entire key pair file instead of the public key to generate the CSR which in turn will go to the CA. This is a very important piece of information that will kill you in any test or interview. The steps are correct but the files being used are wrong. The CSR should be created only with the public key file, the CA will generate a certificate. After verification, the CA sends you a signed digital certificate that contains your distinguished name, your public key, the CA's distinguished name, and the signature of the certificate authority. You store this signed certificate in your key database.

    • @LeXT89
      @LeXT89 Před rokem +1

      Are you serious ? "CSRs are signed using the private key to prevent tampering in transit to the CA.

    • @flymoracer
      @flymoracer Před rokem

      @@LeXT89 That’s correct. The private key file, which also contains the public key information, is used to sign the CSR. The CSR does not contain the private key. It isn't necessary to extract the public key to create a CSR. OpenSSL supports the creation of the CSR directly from the private key file.

  • @Marek-MAROGO
    @Marek-MAROGO Před 20 dny

    Thanks from Poland!👍

  • @HistoryChannel80
    @HistoryChannel80 Před 2 lety

    Thank you very much. Was thinking I will never get it with this csr.

  • @jakobyaro6428
    @jakobyaro6428 Před 10 měsíci

    thanks bro, you are the best

  • @yv9296
    @yv9296 Před 3 lety +2

    excellent video. thank you.

  • @ganeshraj5328
    @ganeshraj5328 Před 2 lety

    Thankyou. Video was very clear

  • @santhoshnagamalla4302

    Awesome explanation bro !!!

  • @demontagemontage
    @demontagemontage Před 3 lety +1

    how to creat command "CLS" clear screen in this toolkit , or same equivalent???????????????????????

  • @thanmayanaik2002
    @thanmayanaik2002 Před 2 lety +1

    Thanks a lot for the precise, and informative video.

  • @madhamsettypreetham1261

    Thanks for the clear explanation

  • @asuteles201
    @asuteles201 Před 3 lety +4

    Hi sir,
    I want to configure certificate based authentication, it requirement
    1.CA,
    2.User Certificate,
    3.server certificate.
    What should I do, whether is same with you do?

  • @vivekprajapati7911
    @vivekprajapati7911 Před 4 lety +1

    really great way of teaching thanks.

  • @datonernegen
    @datonernegen Před rokem

    Thank you, really helped me!

  • @ajaiyapandey5058
    @ajaiyapandey5058 Před rokem

    Thanks for the great tutorials. How I securely push these key (private & cer) in jks file ?

  • @selvendranbtech
    @selvendranbtech Před 3 lety +2

    Good explanation in detail. I have one query in terms of renewal. To renew the existing CA signed certificate, is it correct to give old CSR (CSR generated to get CA signed initially). Is there any validity for key pair and CSR generated?

  • @dennisgarber
    @dennisgarber Před 3 lety +1

    Great video, but you now have weird files on your computer. What do you do with these weird files. Do I ftp to my server, control panel, do I need to go to ican or other ssl org to upload them?

  • @travelwalk539
    @travelwalk539 Před 3 lety +1

    Good explanation , keep it up

  • @jiten6mar
    @jiten6mar Před rokem

    Nice video in detail. I have one question in terms of renewal. To renew the existing CA signed certificate, is it correct to give old CSR (CSR generated to get CA signed initially). Is there any validity for key pair and CSR generated?

  • @engrkn
    @engrkn Před 3 lety +1

    Good job mate :) PK/ISB at last someone from PK

  • @noorullashaik1784
    @noorullashaik1784 Před 2 lety

    Good job clearly explained

  • @gildonghong563
    @gildonghong563 Před 3 lety

    Thank you bro!!
    you are save my life!!

  • @raghuZanne
    @raghuZanne Před 2 lety

    Awesome explanation. Thank you!

  • @andresfd89
    @andresfd89 Před 2 lety

    Thank you very much, very clear and to the point!

  • @AlHoussem
    @AlHoussem Před 3 lety +1

    Great Tutorial, Thanks

  • @brajeshpatel2810
    @brajeshpatel2810 Před 3 lety

    superb knowledge ... my friend .. keep sharing it..

  • @SupraRyu
    @SupraRyu Před 2 lety +1

    Great job!

  • @amj7573
    @amj7573 Před 2 lety

    Very nice video. Thank you very much. How to create certificate with encryption and does the server also should have a certificate with encrypted key? And also can we use Portecle to generate certificates with encrypted key for linux?

  • @jurijus01
    @jurijus01 Před 3 lety +1

    Thanks a lot!!! Exactly what I was looking for

  • @georgebenjamin6632
    @georgebenjamin6632 Před 2 lety

    Well done for this nice video

  • @kurunari5754
    @kurunari5754 Před 2 lety +1

    please help 9:50
    when i tried to self-sign i got the following output instead of 'Signature Ok'
    output:
    openssl x509 -in friday.csr -out friday.crt -req - signkey friday.key -days 365
    x509: Use -help for summary.
    everything until that is clear, someone pls help fast.

    • @kurunari5754
      @kurunari5754 Před 2 lety

      i'm unable to generate tha crt file , pls help

  • @unemployedcse3514
    @unemployedcse3514 Před rokem

    Awesome 😍

  • @ruchigarg7788
    @ruchigarg7788 Před 3 lety +1

    Thanks, Its really helpful.

  • @icanada4
    @icanada4 Před rokem

    Thank you!

  • @mark-theeverydayimagineer6163

    Great presentation - thanks

  • @jibrankhan499
    @jibrankhan499 Před 3 lety +1

    Job saving info for me.

  • @AQEELAbdulmajeed-dh1ti
    @AQEELAbdulmajeed-dh1ti Před 3 lety +1

    I Like it.

  • @Nyemaster
    @Nyemaster Před 3 lety +1

    Thanks - I had all this confused. You helped a lot. Now how do I get this into Windows 10?

    • @TutorialsPediaVideos
      @TutorialsPediaVideos  Před 3 lety

      Thanks Dave for your feedback. You can download windows version of openssl and use it in your machine. I myself created this tutorial in Windows 10.

    • @mubasherchaudhary5223
      @mubasherchaudhary5223 Před 3 lety

      I also had a problem with installing it on windows but then I found this tutorial helpful
      czcams.com/video/YNKUpNpM0Q0/video.html&ab_channel=TechDeepDiveTechDeepDive

  • @amirkian1181
    @amirkian1181 Před rokem

    Can you tell me how we can extract the private key from the key pair, as well as the public key?

  • @electrotsmishar
    @electrotsmishar Před 3 lety +1

    very helpful. thank you

  • @lkinsmusic
    @lkinsmusic Před 2 lety

    Hello when i use command for create csr file. This file is not shown when type dir command
    it is not created. Why this issue happened ?

  • @karthickd7
    @karthickd7 Před 2 lety

    Command to create self signed certificate with csr and private key is not working shows x509: Use -help for summary. any idea?

  • @okey1317
    @okey1317 Před rokem

    6:00 Why did you pass the initial key file? .. shouldnt we pass the public key file?

  • @My_Name_Is_Prashant
    @My_Name_Is_Prashant Před 2 lety

    wow..
    It helped me a lot

  • @AlianeAbdelouahab
    @AlianeAbdelouahab Před 3 lety

    this is just perfect, simple, effective !

  • @EndlessTech
    @EndlessTech Před rokem

    Very informative 😊👏

  • @KeremPARLAKGUMUS-uc4xb

    thank you very much, it was very useful

  • @gianlucavenditti4109
    @gianlucavenditti4109 Před 2 lety

    Good job! Thank you!

  • @Mocka-yf4ez
    @Mocka-yf4ez Před 2 lety +1

    awsome!!!!!!

  • @mta5948
    @mta5948 Před 3 lety

    good video, very nicely explained. thanks

  • @kishoreyadav9317
    @kishoreyadav9317 Před 3 lety +2

    I am getting Can't open -testauto.key for reading, No such file or directory error any idea ?? followed the same steps

  • @6962943
    @6962943 Před 3 lety

    wow thank you explained so clearly

  • @enriquecaballero15
    @enriquecaballero15 Před 3 lety +1

    great tutorial, thank you!

  • @rupeshgawas4905
    @rupeshgawas4905 Před rokem

    thank you bhai

  • @bharathikommu9016
    @bharathikommu9016 Před rokem

    Hisir.
    How do one vedio on how to create csr repo

  • @cheers1963
    @cheers1963 Před rokem

    Thank you sir

  • @Jennn
    @Jennn Před 2 lety

    Thank you So Much Sir

  • @SureshBabu-of5jh
    @SureshBabu-of5jh Před 3 lety

    In this case can we generate public keys and match with public keys being used by differenrt companies?

  • @bhaveshdwivedi3549
    @bhaveshdwivedi3549 Před 2 lety

    CAn you create an video about self signing code signing certificate

  • @EamoAmin
    @EamoAmin Před 3 lety +1

    Thank you

  • @sudhanshutiwari7916
    @sudhanshutiwari7916 Před 2 lety

    how can we stop the stdin for step 3 like country name etc, and provide through argparser ?

  • @edalee5935
    @edalee5935 Před 3 lety +1

    It's very helpful~!

  • @sharadregoti7742
    @sharadregoti7742 Před 3 lety

    Can you also make a video on certificate chaining / Intermediate CAS

  • @shwetasugurmath5390
    @shwetasugurmath5390 Před 2 lety

    If I want to create SSL certificates on cluster having 4-5 nodes, can we have same crt copied to all hosts?

  • @kumarmanish9046
    @kumarmanish9046 Před rokem

    3:25 you have not generated key PAIR right? You have just created the private key. Where is the public key?

  • @ceeeskayaar2281
    @ceeeskayaar2281 Před 2 lety

    info given in this video was insufficient to running localhost with https using openssl certificate. It ended with net::cert_common_name_invalid error in chrome on windows and also with hhtps strickedout in url with no green lock in browser address bar. I appreciate further help to fix the error...

  • @jackpitts5561
    @jackpitts5561 Před 3 lety +2

    too coder-centric, start by definiing the problem using vitual aides. What is happening from a helicopter view, what are the keys for, why are they needed, who holds which keys and why. etc....

    • @TutorialsPediaVideos
      @TutorialsPediaVideos  Před 3 lety +2

      Dear Jack,
      Thanks for your feedback. This tutorial is mainly covering opnssl commands from technical point of view.
      For functional use cases, will create another video to address your concerns :)

  • @saikrishnamerugu6118
    @saikrishnamerugu6118 Před 7 měsíci

    executing openssl command to generate key pair using "openssl genrsa -out keyfile.key 2048" but facing an error "genrsa: Can't open "keyfile.key" for writing, Permission denied". Could you guide me hot to fix this

  • @jamely15
    @jamely15 Před 4 lety

    Nice explanation ! Thank you !

  • @dovelrob
    @dovelrob Před 4 lety +1

    thanks for your help bro

  • @vipul6304
    @vipul6304 Před 2 lety +1

    Hi, how can get my Certicate Signed by 'CA' instead of Self-Signed?

    • @TutorialsPediaVideos
      @TutorialsPediaVideos  Před 2 lety

      Hi Vipul,
      Once you have created CSR, in order to get it signed by a CA, you need to share your CSR with a CA for the subsequent steps.

    • @vipul6304
      @vipul6304 Před 2 lety

      @@TutorialsPediaVideos thanks, is there a free CA that you know?

  • @sampande45
    @sampande45 Před rokem

    How to solve the invalid digest for sha1 error while creating csr

  • @SherinSunny-rj3py
    @SherinSunny-rj3py Před 3 lety

    i am getting an error saying warning can't open config file: C:/OpenSSL/openssl.cnf please do help

  • @rs-tarxvfz
    @rs-tarxvfz Před 3 lety +1

    5:40 WHY DO I have to provide my *Private key* to the *CA Authority* for CSR , This seems to be wrong to me. Please explain.

    • @TutorialsPediaVideos
      @TutorialsPediaVideos  Před 3 lety

      I believe you misunderstood the point. I explained in the video that CSR is shared with the CA.

    • @davidcrealogix9435
      @davidcrealogix9435 Před 3 lety

      only for creation of the csr file the private key is needed. in the csr file itself only the public key is contained.
      en.wikipedia.org/wiki/Certificate_signing_request

    • @subhakardondapati8340
      @subhakardondapati8340 Před 3 lety +1

      @@TutorialsPediaVideos I see in the command you used to generate cert, you used private key... is the public key need to be given? please clarify

    • @pabloandrade339
      @pabloandrade339 Před 3 lety +1

      @@subhakardondapati8340 you are correct. i think the video is using the entire key pair file instead of the public key to generate the CSR which in turn will go to the CA. This is a very important piece of information that will kill you in any test or interview.

  • @itigloostudio957
    @itigloostudio957 Před 2 lety

    Thanks.

  • @namanbajpai6107
    @namanbajpai6107 Před 2 lety

    Thanks ..

  • @My_Name_Is_Prashant
    @My_Name_Is_Prashant Před 2 lety

    where do we need self signed certificate in real world scenario...

  • @happyverma91
    @happyverma91 Před 2 lety

    Can I deploy certificate on godaddy domain?

  • @fanig1458
    @fanig1458 Před 3 lety

    How should I verify that same csr for the crt that was created