Configure HTTPS for Spring Boot application on localhost with self-signed certificate

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ก.ค. 2024
  • Secure connection is required standard nowadays. In this video, I'd like to share with you about how to enable SSL for a Spring Boot application using self-signed certificate, for the purpose of development on local computer (localhost).
    In details, you will learn:
    - Generate SSL self-signed certificate using Java keytool
    - Enable HTTPS for a Spring Boot application
    - Install self-signed certificate on local computer so your browser will trust the certificate
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 69

  • @NickBunton
    @NickBunton 2 ปีที่แล้ว +3

    Exactly what I was looking for, thank you!

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      Glad I could help!

  • @MDAnashAnsari
    @MDAnashAnsari 2 ปีที่แล้ว +1

    Crisp and Clear. Thanks for your efforts.....

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      You're most welcome

  • @TheSpeedX
    @TheSpeedX 2 ปีที่แล้ว +5

    This is a video i was looking for.

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      Glad to hear that. Enjoy!

  • @baxter6504
    @baxter6504 ปีที่แล้ว

    At last! A TH-cam techie who is actually a domain expert. Thank you, sir. You’ve presented the most effective and informative tutorial on generating self-signed certs for Spring Boot applications. Keep up the good work!

    • @CodeJava
      @CodeJava  ปีที่แล้ว +1

      Wow, thanks!

  • @user-ms5sd7bs6r
    @user-ms5sd7bs6r 2 หลายเดือนก่อน

    This video is very very useful, thank you!!!

    • @CodeJava
      @CodeJava  2 หลายเดือนก่อน

      Glad it was helpful!

  • @FullStackDevGreg
    @FullStackDevGreg 8 หลายเดือนก่อน +1

    Straigth forward well done Sir

    • @CodeJava
      @CodeJava  8 หลายเดือนก่อน

      glad this video is helpful.

  • @kraisrioaun8182
    @kraisrioaun8182 3 หลายเดือนก่อน

    Thank you for sharing. It was helpful to me.

    • @CodeJava
      @CodeJava  3 หลายเดือนก่อน

      I'm so glad! Thanks for watching :)

  • @joelchabzola8870
    @joelchabzola8870 2 ปีที่แล้ว

    Thanks for sharing

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      My pleasure

  • @KCTsangKen
    @KCTsangKen ปีที่แล้ว

    A very good video, it is very helpful! Just one question: I see that you were using SSL and I want to know if TLS is configured the same way, thank you!

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      I don't know about TLS.

  • @abhaymishra8112
    @abhaymishra8112 ปีที่แล้ว

    That's a good video...

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      Glad you enjoyed it

  • @bohdankalika
    @bohdankalika ปีที่แล้ว

    Hi, can I use the same configuration/implementation for the reactive programming in WebFlux? Or for this reason the SSL implementation is different?

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      I think you can because SSL is independent of application layer.

  • @brazo98
    @brazo98 2 ปีที่แล้ว

    Nam you are realy the spring boot dude! Thx a lot dor this movie! Nice day!

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว +1

      Welcome. Enjoy it!

    • @saftaleonard7588
      @saftaleonard7588 2 ปีที่แล้ว +1

      You shoud try his udemy courses. They're great. I'm halfway trough one of them and it worths every cent.

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      @@saftaleonard7588 thanks a lot for your recommendation.

    • @brazo98
      @brazo98 2 ปีที่แล้ว +1

      No, Nam is the best teacher ever! I line Nammmmm🖖🏻🖖🏻🖖🏻💪💪💪😻😻😻King of Spring Boot and lot of other Java things! 🖖🏻🖖🏻🖖🏻🖖🏻

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว +1

      @@brazo98 thanks a lot for your encouragement. I'm happy.

  • @talentinfo2795
    @talentinfo2795 2 ปีที่แล้ว +1

    Hi , 443 port is in use and when i am configuring 8443 or any other port than i am getting "The Tomcat connector configured to listen on port 8443 failed to start. The port may already be in use or the connector may be misconfigured."
    I have set that as server.port in application.properties file. can you plz help me
    8443 is not in use but still getting the above error

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      I don't know why. Why not turn off the app that is using port 443?

    • @thetravelinggene
      @thetravelinggene ปีที่แล้ว

      I have a feeling that I am in the same class that is using this. In your Console view, you need to click [Terminate] and then the [Remove All Terminated Launches], this will shut it down to where you can run it again.

  • @saadmalikofficial
    @saadmalikofficial 2 ปีที่แล้ว

    Whats the version of SSL? Is there any ways I can check. I suppose latest versions of SSL are called TLS ?
    Please advise

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว +1

      yes, it is TLS technically.

  • @Misskieutra
    @Misskieutra ปีที่แล้ว +1

    Cam on anh :)

  • @hendisantika
    @hendisantika 2 ปีที่แล้ว +1

    I already followed the steps. The certificate is there. But, chrome said it is still invalid. What should I do?

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      you need to add your self-signed certificate to the Trusted Root Certification Authorities. See: www.codejava.net/frameworks/spring-boot/configure-https-with-self-signed-certificate

  • @francksgenlecroyant
    @francksgenlecroyant 2 ปีที่แล้ว +2

    I am always learning new stuffs from Nam! But is it possible to do this when the front end is built with ReactJS or once the front end is built with ReactJS I must do this with a JS backend framework ?

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว +2

      I think it (SSL) doesn't relate to any frameworks. It's in the network protocol layer.

    • @francksgenlecroyant
      @francksgenlecroyant 2 ปีที่แล้ว +1

      @@CodeJava Thanks bro!

  • @geosystems2106
    @geosystems2106 ปีที่แล้ว

    This was very windows specific. Second part would be very different on linux, rite ? :)

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      Right. you must find the equivalent commands on linux.

  • @marypaul9627
    @marypaul9627 ปีที่แล้ว

    hi have followed same steps but when i copy to my project its always saying that it could not load classpath

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      without further information (e.g. exception details), i don't know why.

  • @Mukesh1987ism
    @Mukesh1987ism 2 ปีที่แล้ว +1

    After configuring SSL, the REST API call is stop working, can you please help me on this?

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว +1

      I have no idea why. Maybe you forgot to update http scheme to https somewhere?

    • @robertorojaswilson2960
      @robertorojaswilson2960 ปีที่แล้ว

      x2

  • @108vicky
    @108vicky 7 หลายเดือนก่อน

    nice :)

    • @CodeJava
      @CodeJava  7 หลายเดือนก่อน

      Thanks!

  • @durmaztekeli
    @durmaztekeli ปีที่แล้ว

    Illegal option: -validity
    keytool -genkeypair [OPTION]...
    what can i do for that?

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      I think something wrong with your command. Check this article for the correct one: www.codejava.net/frameworks/spring-boot/configure-https-with-self-signed-certificate

    • @durmaztekeli
      @durmaztekeli ปีที่แล้ว

      @@CodeJava i copied command in this article.
      after when i removed the validity that it works for me

  • @gautamithakur4132
    @gautamithakur4132 2 ปีที่แล้ว

    I am getting parseAlgParameter failed ..so what is the solution

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      sorry I don't know

  • @rith-sz5js
    @rith-sz5js ปีที่แล้ว

    Hello brother if our spring boot is https so when we deploy it still https or http please reply me thank u 🥰

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      it depends configuration on the server. Meaning that when deploying you need to configure HTTPS on server.

    • @rith-sz5js
      @rith-sz5js ปีที่แล้ว

      @@CodeJava thanks

  • @durmaztekeli
    @durmaztekeli ปีที่แล้ว

    Could you take a video for Linux?

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      Yes, i will do some videos on a VPS with CentOS

  • @thonghoangpham6085
    @thonghoangpham6085 10 หลายเดือนก่อน

    please guide to configure it in intellij, i am learning your spring boot course on udemy

    • @CodeJava
      @CodeJava  10 หลายเดือนก่อน

      oh, I think it doesn't depend on IDE.

    • @thonghoangpham6085
      @thonghoangpham6085 10 หลายเดือนก่อน

      @@CodeJava I wrote the code in the same modular format as your course on udemy, when I watched this video and followed it, it gave me an error that this configuration file could not be found even though I put it in the resources folder

  • @TranDucViet-iu9to
    @TranDucViet-iu9to ปีที่แล้ว

    i want to remove self-signed certificate, how do i ?

    • @CodeJava
      @CodeJava  ปีที่แล้ว

      just delete the SSL configuration in the application.properties file.

  • @antonytran229
    @antonytran229 ปีที่แล้ว +1

    Anh có thể cài tiếng Việt được k :))

  • @rameshbari1984
    @rameshbari1984 2 ปีที่แล้ว

    Where is source code??

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      You can find config code example in the written article here www.codejava.net/frameworks/spring-boot/configure-https-with-self-signed-certificate
      For the code of the project, check in this article: www.codejava.net/frameworks/spring-boot/social-login-with-facebook-example

  • @loinguyenuc6730
    @loinguyenuc6730 2 ปีที่แล้ว

    Spring Boot Websocket Chat Pls

    • @CodeJava
      @CodeJava  2 ปีที่แล้ว

      I will do in future. Thanks for your great suggestion :)

    • @IvanRandomDude
      @IvanRandomDude ปีที่แล้ว

      Basic chat is relatively simple to do in spring boot (send and receive messages) and there are already tutorials online. But if you want advanced features like presence tracker, user typing indicator, message seen indicator, delete messages for me/for everyone, support for photos and videos etc then it is great project to showcase your abilities but it would not be possible to do in one video.