Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to select an ALPN protocol when using QSslSocket (TLS)
Qt 6.11 is out! See what's new in the release blog

How to select an ALPN protocol when using QSslSocket (TLS)

Scheduled Pinned Locked Moved Solved General and Desktop
3 Posts 2 Posters 415 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • Linus JahnL Offline
    Linus JahnL Offline
    Linus Jahn
    wrote on last edited by
    #1

    I'd like to use QSslSocket to connect to an XMPP server by using direct TLS (no STARTTLS) and I'd like to select the correct ALPN protocol (xmpp-client) if the server supports the ALPN TLS extension (and ideally abort the connection if ALPN is supported but the 'xmpp-client' protocol isn't offered).

    I only found QSslConfiguration::setAllowedNextProtocols() (see https://doc.qt.io/qt-6/qsslconfiguration.html#setAllowedNextProtocols), but it seems like this is only used when I host a server (?).

    Thanks in advance!

    artwawA 1 Reply Last reply
    0
    • Linus JahnL Linus Jahn

      I'd like to use QSslSocket to connect to an XMPP server by using direct TLS (no STARTTLS) and I'd like to select the correct ALPN protocol (xmpp-client) if the server supports the ALPN TLS extension (and ideally abort the connection if ALPN is supported but the 'xmpp-client' protocol isn't offered).

      I only found QSslConfiguration::setAllowedNextProtocols() (see https://doc.qt.io/qt-6/qsslconfiguration.html#setAllowedNextProtocols), but it seems like this is only used when I host a server (?).

      Thanks in advance!

      artwawA Offline
      artwawA Offline
      artwaw
      wrote on last edited by
      #2

      @Linus-Jahn said in How to select an ALPN protocol when using QSslSocket (TLS):

      but it seems like this is only used when I host a server (?).

      This function sets the allowed protocols to be negotiated with the server

      This sentence implies something opposite?

      For more information please re-read.

      Kind Regards,
      Artur

      1 Reply Last reply
      1
      • Linus JahnL Offline
        Linus JahnL Offline
        Linus Jahn
        wrote on last edited by
        #3

        Ahhh okay, sorry, yeah I read that as "if you host a server, these are the allowed protocols clients can negotiate with it".

        1 Reply Last reply
        0
        • Linus JahnL Linus Jahn has marked this topic as solved on

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved