diff options
author | Szymon Kłos <szymon.klos@collabora.com> | 2021-07-21 11:00:01 +0200 |
---|---|---|
committer | Szymon Kłos <eszkadev@gmail.com> | 2021-07-22 12:40:05 +0200 |
commit | 541f6a76d3dfbba9b8e3f1b57f251e4eb8e58bf6 (patch) | |
tree | f88db667a29209d214bd35741d84d570e55e8f66 /net | |
parent | Calc status bar cypress: Test is passing on local and failing on the server. (diff) | |
download | online-541f6a76d3dfbba9b8e3f1b57f251e4eb8e58bf6.tar.gz online-541f6a76d3dfbba9b8e3f1b57f251e4eb8e58bf6.zip |
ssl: setup hostname for SNI
For some servers we receive failure with HTTP 403 Forbidden in WOPI::CheckFileInfo
"Reason: The client software did not provide a hostname using Server
Name Indication (SNI), which is required to access this server"
fixes #2771 : https://github.com/CollaboraOnline/online/issues/2771
Signed-off-by: Szymon Kłos <szymon.klos@collabora.com>
Change-Id: I761b179580481f8882a4526c1d8be4f1c14ad929
Diffstat (limited to 'net')
-rw-r--r-- | net/SslSocket.hpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/net/SslSocket.hpp b/net/SslSocket.hpp index 89ec85cb6c..df44dadc2e 100644 --- a/net/SslSocket.hpp +++ b/net/SslSocket.hpp @@ -44,6 +44,9 @@ public: throw std::runtime_error("Failed to create SSL."); } + if (!SSL_set_tlsext_host_name(_ssl, hostname.c_str())) + LOG_WRN("Failed to set hostname for Server Name Indication [" << hostname << ']'); + SSL_set_bio(_ssl, _bio, _bio); if (isClient) |