Server Name Indication (SNI) (Explained by Example)

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

КОМЕНТАРІ • 51

  • @AhmedAymanElSayed-e1i
    @AhmedAymanElSayed-e1i 9 місяців тому

    Thanks for the video. Very informative and fun 😉.
    I had a question regarding ESNI, when the public is key is used to encrypt the TLS handshake. Which private key will the server use for decryption? Like in your example will it be Ali, Jenny, Mark or a default one?

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

    Dude you're a legend 😂 hilarious and fun.. keep up the good work.. learnt a lot. Subscribed..

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

      Thanks Faraz 😊 glad you enjoyed the content and welcome to the community 🙏

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

    Hi. Few doubts as always.
    1. After you did set up everything and made sure all 3 websites working fine with 1 public ip using SNI, now what will happen if I just specify the public ip address in the browser rather than a domain name? Which content it'll return back?
    2. ESNI needs public key to be present in the DNS entry. The public key you mention here is the public key of HAProxy server right? If so, what configuration changes required in .cfg file for the same?

    • @hnasr
      @hnasr  4 роки тому +6

      Palaniappan RM i can see your knowledge is growing with every question you ask! Which is awesome
      For 1) if you only specify ip address the host SNI will be blank and the SNI handshake will fail on the server.. it is up to the server to serve a default certificate when no host is provided..

    • @hnasr
      @hnasr  4 роки тому +5

      Answer for q2) the public key on the DNS has a matching private key on HAProxy..
      So the client will do DNS get public key encrypted the SNI do tls hello .. and server will decrypt the SNI and look at the host..

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

      @@hnasr we don't have to do any other configuration in HAProxy config file for this private key decryption during TLS hello to work?

  • @jackedelic9188
    @jackedelic9188 3 роки тому +5

    I never knew about an ip address being able to serve multiple domain names. I just double checked by typing in an existing ip address (instead of its domain name) and got 404. I felt cheated at the end of my 4 year CS education.

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

      Yup! connecting through IP is not enough for the server as it doesn’t know which domain / website you want.. some Websites might put defaults though

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

    This explanation is so nice. Thanks!

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

      Appreciate it! Thanks

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

    Dude, this is awesome 👍 like the way you make it fun and interesting and to the point. Great work my friend.

  • @brod515
    @brod515 3 роки тому +3

    33:14 I'm confused here. if you make a query to the DNS for a particular domain, then it is already visible. anyone can see you making that request.
    Edit: 😂spoke too soon I see you address it after.

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

    seriously man, your videos are damn good. Full of technicalities with fun, btw liked your Arabic accent 🤣

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

    Funny Voice of Dad :) :)

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

    Thanks for your effort to make this awosome video!

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

      Chengdong Liao thanks for your comment dear 😊

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

    Wow, great technical video on mutlisite hosting on 1 IP address, even though you confused the hell out of me :-o) LOL

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

    Thanks!

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

      There are so many cool content on the channel. Unbelievable! My first donate in my life starts with it.

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

    Hi, how HAProxy knows which cert should to send to the client for "ali", "mark" or "jenny" backend? Does it try to match backend name & cert name?

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

      Excellent question, during client hello in TLS the client sends the host name it tries to connect. HAProxy takes that host name and match it against each of the three certificate because the certificate has the hostname. And sends the appropriate one that matches. This is called SNI (Server Name Indication)

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

      @@hnasr Okk. I got it..

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

    So this isn't possible without a proxy? You couldn't use SNI, let's say, on a Node server alone?

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

      Of course if that web server supports SNI, caddy and nginx comes to mind

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

    For ESNI, how is the public key of the target domain encrypted when it is sent to the server?

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

      The public key is encrypted as part of the DoH connection between the client and the DNS resolver.

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

    Hey ..nice stuff..
    I wanna ask..
    Can u instruct haproxy to accept any random sni

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

      Hmm you can with scripts assuming you have the certificates for each domain requested

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

      @@hnasr
      Ok..
      Let say I have my.website.com hosted and running fine with a certificate generated...and in haproxy I set the host name let's say to www.google.com ...and make sure the client hello will have www.google.com in the host header..
      Will the tls connection be established????
      Hope u understand what I mean..

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

      The TLS will fail on client because the certificate verification will fail since my.website is not google.com ..
      The TLS can be successful if client decided to ignore certificate verification example in curl -insecure or in browsers clicking “I understand the risk”

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

      @@hnasr
      Wooow..
      Thanks .
      You just made it clear to me..

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

    what is the difference between just using NodeJS vs using haproxy (I don't know what haproxy is)?

    • @AnasLoubadi
      @AnasLoubadi 11 місяців тому

      think of ha proxy as a load balancer that receive request and forward them to backend servers

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

    at 1.5x speed, this presentation is pretty HekTik

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

    can i create smart DNS proxy with this method ?

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

    from where hussin

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

    انت منيين يا حسيين

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

    Hi you forgot to reference the videos in this....

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

      Natesh M Bhat thanks for letting me know! Do you know where timestamp? It would make it easier for me 😊

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

    how can i configure this on an android phone?

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

      this is a pure backend concept, nothing to do in the client except providing the SNI parameter which most SSL libraries do

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

      thanks for the reply, can you make a detailed tutorial on how to correctly configure httpinjector ehi files on android phones to bypass isp for free net?

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

    how i can make a sni account or sign up on sni

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

      safder karim There is no account for SNI, You can just create multiple domains and use the proxy to configure it as I explained in the video

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

    How can i capture android app sni

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

      hey this is a video explaining whats sni is and it is not a video about finding sni -_-

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

    يخربييتك مفهمتش حاجة هههههههههه

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

    27:00