Skip to content

Commit 4e0585b

Browse files
committed
[net] deprecate TSSLSocket
1 parent b01d3db commit 4e0585b

5 files changed

Lines changed: 34 additions & 27 deletions

File tree

gui/guihtml/src/TGHtmlBrowser.cxx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ Ssiz_t ReadSize(const char *url)
268268
return 0;
269269
if (uri.BeginsWith("https://")) {
270270
#ifdef R__SSL
271-
s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
271+
s = new ROOT::Deprecated::TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
272272
#else
273273
::Error("ReadSize", "library compiled without SSL, https not supported");
274274
return 0;
@@ -328,7 +328,7 @@ static char *ReadRemote(const char *url)
328328
return 0;
329329
if (uri.BeginsWith("https://")) {
330330
#ifdef R__SSL
331-
s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
331+
s = new ROOT::Deprecated::TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
332332
#else
333333
::Error("ReadRemote", "library compiled without SSL, https not supported");
334334
return 0;
@@ -699,4 +699,3 @@ Bool_t TGHtmlBrowser::ProcessMessage(Longptr_t msg, Longptr_t parm1, Longptr_t)
699699
}
700700
return kTRUE;
701701
}
702-

gui/guihtml/src/TGHtmlImage.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ static TImage *ReadRemoteImage(const char *url)
236236
TSocket *s;
237237
if (uri.BeginsWith("https://")) {
238238
#ifdef R__SSL
239-
s = new TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
239+
s = new ROOT::Deprecated::TSSLSocket(fUrl.GetHost(), fUrl.GetPort());
240240
#else
241241
::Error("ReadRemoteImage", "library compiled without SSL, https not supported");
242242
return 0;

net/net/inc/LinkDef.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
#pragma link C++ class TParallelMergingFile+;
3535

3636
#ifdef R__SSL
37-
#pragma link C++ class TSSLSocket;
37+
#pragma link C++ class ROOT::Deprecated::TSSLSocket;
3838
#endif
3939

4040
#endif

net/net/inc/TSSLSocket.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@
2222

2323
#include "TSocket.h"
2424

25+
namespace ROOT::Deprecated {
26+
2527
typedef struct ssl_st SSL;
2628
typedef struct ssl_ctx_st SSL_CTX;
2729

@@ -78,4 +80,10 @@ class TSSLSocket : public TSocket {
7880
ClassDefOverride(TSSLSocket,0) // SSL wrapped socket
7981
};
8082

83+
} // namespace ROOT::Deprecated
84+
85+
using TSSLSocket R__DEPRECATED(6, 46, "ROOT is not providing an SSL socket API anymore. "
86+
"Consider using SSL tunneling for secure channels.")
87+
= ROOT::Deprecated::TSSLSocket;
88+
8189
#endif

net/net/src/TSSLSocket.cxx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ not limited to, the management of the connections to said sockets.
2626
#include "strlcpy.h"
2727

2828
// Static properties
29-
char TSSLSocket::fgSSLCAFile[FILENAME_MAX] = "";
30-
char TSSLSocket::fgSSLCAPath[FILENAME_MAX] = "";
31-
char TSSLSocket::fgSSLUCert[FILENAME_MAX] = "";
32-
char TSSLSocket::fgSSLUKey[FILENAME_MAX] = "";
29+
char ROOT::Deprecated::TSSLSocket::fgSSLCAFile[FILENAME_MAX] = "";
30+
char ROOT::Deprecated::TSSLSocket::fgSSLCAPath[FILENAME_MAX] = "";
31+
char ROOT::Deprecated::TSSLSocket::fgSSLUCert[FILENAME_MAX] = "";
32+
char ROOT::Deprecated::TSSLSocket::fgSSLUKey[FILENAME_MAX] = "";
3333

3434
////////////////////////////////////////////////////////////////////////////////
3535
// SSL debugging
3636

37-
void ssl_info_callback(const SSL* ssl, int where, int ret)
37+
static void ssl_info_callback(const SSL* ssl, int where, int ret)
3838
{
3939
if (ret == 0) {
4040
std::cout << "-- ssl_info_callback: error occurred.\n";
@@ -50,7 +50,7 @@ void ssl_info_callback(const SSL* ssl, int where, int ret)
5050
////////////////////////////////////////////////////////////////////////////////
5151
/// Wraps the socket with OpenSSL.
5252

53-
void TSSLSocket::WrapWithSSL(void)
53+
void ROOT::Deprecated::TSSLSocket::WrapWithSSL(void)
5454
{
5555
SSL_library_init();
5656

@@ -108,68 +108,68 @@ void TSSLSocket::WrapWithSSL(void)
108108

109109
////////////////////////////////////////////////////////////////////////////////
110110

111-
TSSLSocket::TSSLSocket(TInetAddress addr, const char *service, Int_t tcpwindowsize)
111+
ROOT::Deprecated::TSSLSocket::TSSLSocket(TInetAddress addr, const char *service, Int_t tcpwindowsize)
112112
: TSocket(addr, service, tcpwindowsize)
113113
{
114114
WrapWithSSL();
115115
}
116116

117117
////////////////////////////////////////////////////////////////////////////////
118118

119-
TSSLSocket::TSSLSocket(TInetAddress addr, Int_t port, Int_t tcpwindowsize)
119+
ROOT::Deprecated::TSSLSocket::TSSLSocket(TInetAddress addr, Int_t port, Int_t tcpwindowsize)
120120
: TSocket(addr, port, tcpwindowsize)
121121
{
122122
WrapWithSSL();
123123
}
124124

125125
////////////////////////////////////////////////////////////////////////////////
126126

127-
TSSLSocket::TSSLSocket(const char *host, const char *service, Int_t tcpwindowsize)
127+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const char *host, const char *service, Int_t tcpwindowsize)
128128
: TSocket(host, service, tcpwindowsize)
129129
{
130130
WrapWithSSL();
131131
}
132132

133133
////////////////////////////////////////////////////////////////////////////////
134134

135-
TSSLSocket::TSSLSocket(const char *url, Int_t port, Int_t tcpwindowsize)
135+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const char *url, Int_t port, Int_t tcpwindowsize)
136136
: TSocket(url, port, tcpwindowsize)
137137
{
138138
WrapWithSSL();
139139
}
140140

141141
////////////////////////////////////////////////////////////////////////////////
142142

143-
TSSLSocket::TSSLSocket(const char *sockpath) : TSocket(sockpath)
143+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const char *sockpath) : TSocket(sockpath)
144144
{
145145
WrapWithSSL();
146146
}
147147

148148
////////////////////////////////////////////////////////////////////////////////
149149

150-
TSSLSocket::TSSLSocket(Int_t desc) : TSocket(desc)
150+
ROOT::Deprecated::TSSLSocket::TSSLSocket(Int_t desc) : TSocket(desc)
151151
{
152152
WrapWithSSL();
153153
}
154154

155155
////////////////////////////////////////////////////////////////////////////////
156156

157-
TSSLSocket::TSSLSocket(Int_t desc, const char *sockpath) : TSocket(desc, sockpath)
157+
ROOT::Deprecated::TSSLSocket::TSSLSocket(Int_t desc, const char *sockpath) : TSocket(desc, sockpath)
158158
{
159159
WrapWithSSL();
160160
}
161161

162162
////////////////////////////////////////////////////////////////////////////////
163163

164-
TSSLSocket::TSSLSocket(const TSSLSocket &s) : TSocket(s)
164+
ROOT::Deprecated::TSSLSocket::TSSLSocket(const TSSLSocket &s) : TSocket(s)
165165
{
166166
WrapWithSSL();
167167
}
168168

169169
////////////////////////////////////////////////////////////////////////////////
170170
/// Close gracefully the connection, and free SSL structures.
171171

172-
TSSLSocket::~TSSLSocket()
172+
ROOT::Deprecated::TSSLSocket::~TSSLSocket()
173173
{
174174
Close();
175175
if (fSSL)
@@ -181,7 +181,7 @@ TSSLSocket::~TSSLSocket()
181181
////////////////////////////////////////////////////////////////////////////////
182182
/// Close the SSL connection.
183183

184-
void TSSLSocket::Close(Option_t *option)
184+
void ROOT::Deprecated::TSSLSocket::Close(Option_t *option)
185185
{
186186
if (fSSL)
187187
SSL_shutdown(fSSL);
@@ -191,8 +191,8 @@ void TSSLSocket::Close(Option_t *option)
191191
////////////////////////////////////////////////////////////////////////////////
192192
/// Set up the static configuration variables.
193193

194-
void TSSLSocket::SetUpSSL(const char *cafile, const char *capath,
195-
const char *ucert, const char *ukey)
194+
void
195+
ROOT::Deprecated::TSSLSocket::SetUpSSL(const char *cafile, const char *capath, const char *ucert, const char *ukey)
196196
{
197197
if (cafile)
198198
strlcpy(fgSSLCAFile, cafile, FILENAME_MAX);
@@ -206,7 +206,7 @@ void TSSLSocket::SetUpSSL(const char *cafile, const char *capath,
206206

207207
////////////////////////////////////////////////////////////////////////////////
208208

209-
Int_t TSSLSocket::Recv(TMessage *& /*mess */)
209+
Int_t ROOT::Deprecated::TSSLSocket::Recv(TMessage *& /*mess */)
210210
{
211211
Error("Recv", "not implemented");
212212
return -1;
@@ -215,7 +215,7 @@ Int_t TSSLSocket::Recv(TMessage *& /*mess */)
215215
////////////////////////////////////////////////////////////////////////////////
216216
/// Receive a raw buffer of specified length bytes.
217217

218-
Int_t TSSLSocket::RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt)
218+
Int_t ROOT::Deprecated::TSSLSocket::RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt)
219219
{
220220
TSystem::ResetErrno();
221221

@@ -271,7 +271,7 @@ Int_t TSSLSocket::RecvRaw(void *buffer, Int_t length, ESendRecvOptions opt)
271271

272272
////////////////////////////////////////////////////////////////////////////////
273273

274-
Int_t TSSLSocket::Send(const TMessage & /* mess */)
274+
Int_t ROOT::Deprecated::TSSLSocket::Send(const TMessage & /* mess */)
275275
{
276276
Error("Send", "not implemented");
277277
return -1;
@@ -280,7 +280,7 @@ Int_t TSSLSocket::Send(const TMessage & /* mess */)
280280
////////////////////////////////////////////////////////////////////////////////
281281
/// Send a raw buffer of specified length.
282282

283-
Int_t TSSLSocket::SendRaw(const void *buffer, Int_t length, ESendRecvOptions /* opt */)
283+
Int_t ROOT::Deprecated::TSSLSocket::SendRaw(const void *buffer, Int_t length, ESendRecvOptions /* opt */)
284284
{
285285
TSystem::ResetErrno();
286286

0 commit comments

Comments
 (0)