{"id":20564364,"url":"https://github.com/tarantool/go-tlsdialer","last_synced_at":"2026-01-25T16:13:16.609Z","repository":{"id":220156343,"uuid":"750829950","full_name":"tarantool/go-tlsdialer","owner":"tarantool","description":"TLS dialers for the go-tarantool library","archived":false,"fork":false,"pushed_at":"2026-01-19T19:03:20.000Z","size":16,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":7,"default_branch":"master","last_synced_at":"2026-01-20T00:47:37.184Z","etag":null,"topics":["go","go-tarantool","openssl","tarantool"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tarantool.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-01-31T12:04:34.000Z","updated_at":"2024-02-12T17:06:50.000Z","dependencies_parsed_at":"2024-02-12T17:30:05.332Z","dependency_job_id":null,"html_url":"https://github.com/tarantool/go-tlsdialer","commit_stats":null,"previous_names":["tarantool/go-tlsdialer"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/tarantool/go-tlsdialer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgo-tlsdialer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgo-tlsdialer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgo-tlsdialer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgo-tlsdialer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tarantool","download_url":"https://codeload.github.com/tarantool/go-tlsdialer/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tarantool%2Fgo-tlsdialer/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755094,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["go","go-tarantool","openssl","tarantool"],"created_at":"2024-11-16T04:25:58.359Z","updated_at":"2026-01-25T16:13:16.591Z","avatar_url":"https://github.com/tarantool.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![Go Reference][godoc-badge]][godoc-url]\n[![Code Coverage][coverage-badge]][coverage-url]\n\n# tlsdialer\n\nThis package allows creating a TLS dialer for\n[`go-tarantool`](https://github.com/tarantool/go-tarantool).\nIt serves as an interlayer between go-tarantool and go-openssl.\n\ngo-tlsdialer uses tarantool connection, but also types and methods from \ngo-openssl.\n\n## Run tests\n\nTo run a default set of tests:\n\n```go\ngo test -v ./...\n```\n\n## OpenSSLDialer\n\nUser can create a dialer by filling the struct:\n```go\n// OpenSSLDialer allows to use SSL transport for connection.\ntype OpenSSLDialer struct {\n\t// Address is an address to connect.\n\t// It could be specified in following ways:\n\t//\n\t// - TCP connections (tcp://192.168.1.1:3013, tcp://my.host:3013,\n\t// tcp:192.168.1.1:3013, tcp:my.host:3013, 192.168.1.1:3013, my.host:3013)\n\t//\n\t// - Unix socket, first '/' or '.' indicates Unix socket\n\t// (unix:///abs/path/tt.sock, unix:path/tt.sock, /abs/path/tt.sock,\n\t// ./rel/path/tt.sock, unix/:path/tt.sock)\n\tAddress string\n\t// Auth is an authentication method.\n\tAuth tarantool.Auth\n\t// Username for logging in to Tarantool.\n\tUser string\n\t// User password for logging in to Tarantool.\n\tPassword string\n\t// RequiredProtocol contains minimal protocol version and\n\t// list of protocol features that should be supported by\n\t// Tarantool server. By default, there are no restrictions.\n\tRequiredProtocolInfo tarantool.ProtocolInfo\n\t// SslKeyFile is a path to a private SSL key file.\n\tSslKeyFile string\n\t// SslCertFile is a path to an SSL certificate file.\n\tSslCertFile string\n\t// SslCaFile is a path to a trusted certificate authorities (CA) file.\n\tSslCaFile string\n\t// SslCiphers is a colon-separated (:) list of SSL cipher suites the connection\n\t// can use.\n\t//\n\t// We don't provide a list of supported ciphers. This is what OpenSSL\n\t// does. The only limitation is usage of TLSv1.2 (because other protocol\n\t// versions don't seem to support the GOST cipher). To add additional\n\t// ciphers (GOST cipher), you must configure OpenSSL.\n\t//\n\t// See also\n\t//\n\t// * https://www.openssl.org/docs/man1.1.1/man1/ciphers.html\n\tSslCiphers string\n\t// SslPassword is a password for decrypting the private SSL key file.\n\t// The priority is as follows: try to decrypt with SslPassword, then\n\t// try SslPasswordFile.\n\tSslPassword string\n\t// SslPasswordFile is a path to the list of passwords for decrypting\n\t// the private SSL key file. The connection tries every line from the\n\t// file as a password.\n\tSslPasswordFile string\n}\n```\nTo create a connection from the created dialer a `Dial` function could be used:\n```go\npackage tarantool\n\nimport (\n\t\"context\"\n\t\"fmt\"\n\t\"time\"\n\n\t\"github.com/tarantool/go-tarantool/v2\"\n\t\"github.com/tarantool/go-tlsdialer\"\n)\n\nfunc main() {\n\tdialer := tlsdialer.OpenSSLDialer{\n\t\tAddress: \"127.0.0.1:3301\",\n\t\tUser:    \"guest\",\n\t}\n\topts := tarantool.Opts{\n\t\tTimeout: 5 * time.Second,\n\t}\n\n\tctx, cancel := context.WithTimeout(context.Background(), 500*time.Millisecond)\n\tdefer cancel()\n\n\tconn, err := tarantool.Connect(ctx, dialer, opts)\n\tif err != nil {\n\t\tfmt.Printf(\"Failed to create an example connection: %s\", err)\n\t\treturn\n\t}\n\n\t// Use the connection.\n\tdata, err := conn.Do(tarantool.NewInsertRequest(999).\n\t\tTuple([]interface{}{99999, \"BB\"}),\n\t).Get()\n\tif err != nil {\n\t\tfmt.Printf(\"Error: %s\", err)\n\t} else {\n\t\tfmt.Printf(\"Data: %v\", data)\n\t}\n}\n```\n\n## Application build\n\nSince tlsdialer uses OpenSSL for connection to the Tarantool-EE, Cgo should be\nenabled while building and OpenSSL libraries and includes should be available\nin build time.\n\n### Building with system OpenSSL\n\nBuild your application using the command:\n1. **Static build**.\n   ```shell\n   CGO_ENABLED=1 go build -ldflags \"-linkmode external -extldflags '-static -lssl -lcrypto'\" -o myapp main.go\n   ```\n2. **Dynamic build**.\n   ```shell\n   CGO_ENABLED=1 go build -o myapp main.go\n   ```\n\n### Building with a custom OpenSSL version\n\nOpenSSL could be build in two ways. Both of them require downloading the source\ncode of OpenSSL. It could be done from the [official website](https://www.openssl.org/source/)\nor from the [GitHub repository](https://github.com/openssl/openssl).\n1. **Static build**. Run this command from the installation directory to configure\n   the OpenSSL:\n   ```shell\n   ./config no-shared --prefix=/tmp/openssl/\n   ```\n2. **Dynamic build**. Run this command from the installation directory to configure\n   the OpenSSL:\n   ```shell\n   ./config --prefix=/tmp/openssl/\n   ```\n   After configuring, run this command to install and build OpenSSL:\n   ```shell\n   make install\n   ```\nAnd then build your application using the command:\n1. **Static build**.\n   ```shell\n   CGO_ENABLED=1 CGO_CFLAGS=\"-I/tmp/openssl/include\" CGO_LDFLAGS=\"-L/tmp/openssl/lib\" PKG_CONFIG_PATH=\"/tmp/openssl/lib/pkgconfig\" go build -ldflags \"-linkmode=external -extldflags '-static -lssl -lcrypto'\" -o myapp main.go\n   ```\n2. **Dynamic build**.\n   ```shell\n   CGO_ENABLED=1 CGO_CFLAGS=\"-I/tmp/openssl/include\" CGO_LDFLAGS=\"-L/tmp/openssl/lib\" PKG_CONFIG_PATH=\"/tmp/openssl/lib/pkgconfig\" go build -o myapp main.go\n   ```\nAfter compiling your Go application, you can run it as usual.\n\n[godoc-badge]: https://pkg.go.dev/badge/github.com/tarantool/go-tlsdialer.svg\n[godoc-url]: https://pkg.go.dev/github.com/tarantool/go-tlsdialer\n[coverage-badge]: https://coveralls.io/repos/github/tarantool/go-tlsdialer/badge.svg?branch=master\n[coverage-url]: https://coveralls.io/github/tarantool/go-tlsdialer?branch=master\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Fgo-tlsdialer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftarantool%2Fgo-tlsdialer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftarantool%2Fgo-tlsdialer/lists"}