[Spring Boot Security] #15 Enable HTTPS/SSL in Spring Boot

แชร์
ฝัง
  • เผยแพร่เมื่อ 20 ก.ค. 2024
  • ⚫ Description
    In this episode you will learn how to enable HTTPS/SSL for your Spring Boot application. No app is really secure if the data in transit is shown in plain text. SSL secures that data so that a malicious user can not make sense of it. You will also learn:
    - how to generate a self signed certificate
    - how to configure your app for SSL
    _______
    ⚫ Source code
    github.com/dangeabunea/Romani...
    _______
    Check out the latest software programming articles on my blog, where you will find lots of software development tutorials that will sharpen your programming skills
    www.romaniancoder.com
    _______
    ⚫ Say hi on social
    Facebook: / romaniancoder
    Twitter: / romaniancoder
    GitHub:github.com/dangeabunea
    #springboot #spring #java #webapplication #security #ssl #springsecurity #springbootsecurity #dangeabunea
    _______
    Created with ❤️ by Dan Geabunea (Romanian Coder)
  • วิทยาศาสตร์และเทคโนโลยี

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

  • @krztuszenie
    @krztuszenie 5 ปีที่แล้ว +4

    If you are running ubuntu just open terminal and write: keytool -genkeypair -alias myssl -keyalg RSA -keysize 2048 -storetype PKCS12 -keystore myssl.p12 -validity 3650
    Nice video btw :)

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

    Just to add on to this great video if you are using your Spring Boot app as a restful service like I am (AKA Spring Boot app is ONLY used as your backend) you may have tried to send an HTTP request via Postman, rather than the browser. When you try this, you will initially get "Could not get a response" and the reason is because Postman by default rejects self-signed certificates. Go into the Postman settings -> general -> and toggle off the ssl-certificate feature and then it will work. This is of course until you buy a truly signed cert for deployment

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

    This is one of the flawless videos on youtube. Just perfect. Works as charm. Thank you very much!!

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

    I am damn thankful I found your tutorial series! It's amazing and let me improve much as beginner.

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

    Done thanks! Took notes in onenote

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

    Thank you so much for great tutorial.. Keep going..

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

    good, quick and works, but you should paste key generation command in description of video

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

    I was in depression for how the security n all things works... This video made me stable🏂

  • @mubaraktube1
    @mubaraktube1 5 ปีที่แล้ว

    Very good, thanks for helping many people out there

  • @websimo1000
    @websimo1000 5 ปีที่แล้ว

    just Excellent !!

  • @eliasalvest.i.646
    @eliasalvest.i.646 3 ปีที่แล้ว +1

    Vc é incrível!!!

  • @benjamine.ndugga729
    @benjamine.ndugga729 4 ปีที่แล้ว

    This guy is the best!!(

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

    Gracias me funciono para conectar mi api a una app web desde un hosting

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

    I have a ssl certificate however when I do the same steps I get an error of Alias name [tomcat] does not identify a key entry

  • @jamesfrank1159
    @jamesfrank1159 5 ปีที่แล้ว

    Still uses port 8080 despite doing my configurations the way you have done.

  • @nikolapashov5181
    @nikolapashov5181 4 ปีที่แล้ว

    Hey, how can I disable the ssl? I tried to comment out the configuration in the application.properties and in both methods in BootSecurityApplication (httpToHttpsRedirectConnector, servletContainer) but it still doesn't work.

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

    What if I dont use embedded Tomcat container? For example, what if I use OpenLiberty?

  • @newnew1507
    @newnew1507 5 ปีที่แล้ว

    thank you, keep going

    • @RomanianCoder
      @RomanianCoder  5 ปีที่แล้ว

      Thanks for the encouragement

  • @gajanangaikwad8934
    @gajanangaikwad8934 3 ปีที่แล้ว

    Hi Can you tell me how to download the certificate from hostinger or godaddy so that I can use that certificate with my spring boot application

  • @SavranTaha
    @SavranTaha 3 ปีที่แล้ว

    Hi I have .crt .csr .key and .ca-bundle files but not the .p14 file from the video. Can you please help me to get the .p14 file or can you show me how I can use the other files. Thank you.

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

    Hola funciona perfecto, pero cual podría ser la mejor forma para ponerle un certificado ssl?

  • @harivignesh100
    @harivignesh100 4 ปีที่แล้ว

    i am convert .p12 to jks this error happen
    keytool error: java.io.IOException: toDerInputStream rejects tag type 45

  • @jordibellver802
    @jordibellver802 5 ปีที่แล้ว

    Hi there,
    I tried from the code at GH to go back from https to http, comenting the settings at application.properties and commenting the code at BootSecurityApplication: the @Bean and the redirector, but then authentication fails at login as it is not triggering loadUserByUsername. I have no idea why !?!?!?
    Can any explain what else must be reverted to get an http connection?
    (please, don't ask why i need http if i have https... i'm just willing to understand the details, ok?)

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

    Isn't better to have proxy like Nginx that handles SSL Termination?!

  • @rajukapadne6502
    @rajukapadne6502 3 ปีที่แล้ว

    I want to know the scenario , How to get username by reading client certificate ?

  • @rohaslob2
    @rohaslob2 5 ปีที่แล้ว

    Thanks for the great tutorial. Same issue as FG-69 reported below. Post 15 Enable HTTPS/SSL in Spring Boot the roles for ADMIN and MANAGER do not work anymore after putting in the code mentioned in the video. Maybe its resolved in future episodes. The rest endpoint authorities based security still work. Just the roles based security does not work. Please check when you get some time.

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

      i saw that you covered this issue in 18 - Database Authentication - User Repository video. When authorities and roles are used together authorities takes precedence. Thanks

    • @godoyeverton
      @godoyeverton 4 ปีที่แล้ว

      ​@@rohaslob2 Thank you for this information. I had the same problem, and a I didn’t have Idea.
      I am going to copy only for reinforce
      "" When authorities and roles are used together authorities takes precedence ""
      Thank you, best!

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

    I already followed the steps. But, current chrome said that certificate is invalid. What should I do? Thanks

  • @RahulKumar-zz4wo
    @RahulKumar-zz4wo 3 ปีที่แล้ว

    Brother, If possible please make a tutorial on microservices

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

    First of all thanks for this amazing series
    I've a situation when i'm trying to access admin or manager page i can't open them

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

      PS: I've the good login code i can just access to profile page which is a problem for(sorry my english is not good)
      Need help plz

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

      The answer is in 18 - Database Authentication - User Repository video. When authorities and roles are used together authorities takes precedence.

  • @fuadshirinov2116
    @fuadshirinov2116 3 ปีที่แล้ว

    This site can’t be reachedThe connection was reset.
    Try:
    Checking the connection
    Checking the proxy and the firewall
    ERR_CONNECTION_RESET

  • @just_a_simple_man
    @just_a_simple_man 3 ปีที่แล้ว

    My application runs only on the port 8443, but you have it running the both ports 8082 and 8443. How can I solve this problem?

    • @tiagonascimento7613
      @tiagonascimento7613 3 ปีที่แล้ว

      its just add in your properties -> server.port =

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

    not secure problem?

  • @stormdark90
    @stormdark90 5 ปีที่แล้ว

    friend.. why it is not recommended to use self-signed certificates in production? nice vid :)

    • @RomanianCoder
      @RomanianCoder  5 ปีที่แล้ว +3

      Hello! Thanks for the message. Self signed certificates are not recognized and validated by any certificate authority. The browsers will issue warning messages due to this and it will decrease trust levels among users. You probably would not input your bank details in a form that uses self signed :)

  • @rudradash2343
    @rudradash2343 4 ปีที่แล้ว

    i am really confused between AuthenticationProvider vs UserDetailsService.

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

      Hopefully this explanation helps a bit, but if you have ever worked with springboots controller, service, and repository setup for domain objects (so just objects stored to a database), then you can think of UserDetailsService as the service class to UserDetails. AuthenticationProvider is what you actually customize to authenticate a user attempting a login by overriding Authenticate() method. The only difference between UserDetails and say for example just a custom User entity that has a controller, service, and repository class is that UserDetails is not persisted to a database. So it's basically just a way to model a user trying attempting to login.
      Hopefully that made sense, I'm not the best at explaining things.

  • @JarTSW
    @JarTSW 3 ปีที่แล้ว

    you should have shown how to get rid of that warning in browser

    • @SavranTaha
      @SavranTaha 3 ปีที่แล้ว

      You can only do that for your own computer by installing the certificate. For youre clients you have to buy a real certificate

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

    Hi, my name is Danrley and my nickname is Dan, when I saw "Dan" (3:31) I was like "what?" hahahaha

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

    keytool -genkey -alias "kt"-storetype PKCS12 -keyalg RSA -keysize 2048 -keystore "kt".p12 -validity 3650 replace things betweens " "