@@ -205,115 +205,6 @@ func (d NetDialer) Dial(ctx context.Context, opts DialOpts) (Conn, error) {
205205 return dialer .Dial (ctx , opts )
206206}
207207
208- type openSslDialer struct {
209- address string
210- sslKeyFile string
211- sslCertFile string
212- sslCaFile string
213- sslCiphers string
214- sslPassword string
215- sslPasswordFile string
216- }
217-
218- func (d openSslDialer ) Dial (ctx context.Context , opts DialOpts ) (Conn , error ) {
219- var err error
220- conn := new (tntConn )
221-
222- network , address := parseAddress (d .address )
223- conn .net , err = sslDialContext (ctx , network , address , sslOpts {
224- KeyFile : d .sslKeyFile ,
225- CertFile : d .sslCertFile ,
226- CaFile : d .sslCaFile ,
227- Ciphers : d .sslCiphers ,
228- Password : d .sslPassword ,
229- PasswordFile : d .sslPasswordFile ,
230- })
231- if err != nil {
232- return nil , fmt .Errorf ("failed to dial: %w" , err )
233- }
234-
235- dc := & deadlineIO {to : opts .IoTimeout , c : conn .net }
236- conn .reader = bufio .NewReaderSize (dc , bufSize )
237- conn .writer = bufio .NewWriterSize (dc , bufSize )
238-
239- return conn , nil
240- }
241-
242- // OpenSslDialer allows to use SSL transport for connection.
243- type OpenSslDialer struct {
244- // Address is an address to connect.
245- // It could be specified in following ways:
246- //
247- // - TCP connections (tcp://192.168.1.1:3013, tcp://my.host:3013,
248- // tcp:192.168.1.1:3013, tcp:my.host:3013, 192.168.1.1:3013, my.host:3013)
249- //
250- // - Unix socket, first '/' or '.' indicates Unix socket
251- // (unix:///abs/path/tnt.sock, unix:path/tnt.sock, /abs/path/tnt.sock,
252- // ./rel/path/tnt.sock, unix/:path/tnt.sock)
253- Address string
254- // Auth is an authentication method.
255- Auth Auth
256- // Username for logging in to Tarantool.
257- User string
258- // User password for logging in to Tarantool.
259- Password string
260- // RequiredProtocol contains minimal protocol version and
261- // list of protocol features that should be supported by
262- // Tarantool server. By default, there are no restrictions.
263- RequiredProtocolInfo ProtocolInfo
264- // SslKeyFile is a path to a private SSL key file.
265- SslKeyFile string
266- // SslCertFile is a path to an SSL certificate file.
267- SslCertFile string
268- // SslCaFile is a path to a trusted certificate authorities (CA) file.
269- SslCaFile string
270- // SslCiphers is a colon-separated (:) list of SSL cipher suites the connection
271- // can use.
272- //
273- // We don't provide a list of supported ciphers. This is what OpenSSL
274- // does. The only limitation is usage of TLSv1.2 (because other protocol
275- // versions don't seem to support the GOST cipher). To add additional
276- // ciphers (GOST cipher), you must configure OpenSSL.
277- //
278- // See also
279- //
280- // * https://www.openssl.org/docs/man1.1.1/man1/ciphers.html
281- SslCiphers string
282- // SslPassword is a password for decrypting the private SSL key file.
283- // The priority is as follows: try to decrypt with SslPassword, then
284- // try SslPasswordFile.
285- SslPassword string
286- // SslPasswordFile is a path to the list of passwords for decrypting
287- // the private SSL key file. The connection tries every line from the
288- // file as a password.
289- SslPasswordFile string
290- }
291-
292- // Dial makes OpenSslDialer satisfy the Dialer interface.
293- func (d OpenSslDialer ) Dial (ctx context.Context , opts DialOpts ) (Conn , error ) {
294- dialer := AuthDialer {
295- Dialer : ProtocolDialer {
296- Dialer : GreetingDialer {
297- Dialer : openSslDialer {
298- address : d .Address ,
299- sslKeyFile : d .SslKeyFile ,
300- sslCertFile : d .SslCertFile ,
301- sslCaFile : d .SslCaFile ,
302- sslCiphers : d .SslCiphers ,
303- sslPassword : d .SslPassword ,
304- sslPasswordFile : d .SslPasswordFile ,
305- },
306- },
307- RequiredProtocolInfo : d .RequiredProtocolInfo ,
308- },
309- Auth : d .Auth ,
310- Username : d .User ,
311- Password : d .Password ,
312- }
313-
314- return dialer .Dial (ctx , opts )
315- }
316-
317208type fdAddr struct {
318209 Fd uintptr
319210}
0 commit comments