ssl - 如何在 Go 中建立到 memsql 的基于 ssl 的 tcp 连接

标签 ssl go tcp singlestore

我正在尝试使用 Go 设置到 memsql 的基于 ssl 的 tcp 连接。

应用程序/服务作为 openshift pod 运行并用 Go 编写。

  1. 我可以从该服务对 memsql 进行单向身份验证吗?
  2. 我是否需要在 memsql 中启用任何端口来监听基于 tls 的 ssl 连接?
  3. 除了将我的服务中的 DSN 更新为 tls=true 之外,还有什么方法可以自定义此配置。
  4. 有人可以建议一种有效的方法来连接启用 ssl 的 memsql 吗?

我已经关注了 memsql documentation并将证书插入到 memsql master 和聚合器中,并启用了权限检查,但我仍然能够进入 memsql 而无需在登录中提供 rootCertificate。

目前连接是通过以下代码建立的:

db, err := sql.Open("mysql", DSN) and
DSN=root:@tcp(IPAddress:3306)/riodev?interpolateParams=true&parseTime=true

最佳答案

  1. 你能澄清一下你的问题是什么吗? SSL 身份验证是单向的,客户端验证服务器。服务器通过登录信息验证客户端。

  2. 不,MemSQL 对 SSL 和非 SSL 连接使用相同的端口。

  3. 您可能还需要配置 SSL 证书,如 https://github.com/go-sql-driver/mysql#tls 中所述.

  4. 大多数客户端库都支持使用 SSL 连接。

I've followed the memsql documentation and inserted the certificates to memsql master and aggregator, as well as made the permission check enabled, but still I'm able to get into the memsql without giving the rootCertificate in the login.

连接是否可能已经在使用 SSL?它可能在未验证证书的情况下使用 SSL 首选模式。

关于ssl - 如何在 Go 中建立到 memsql 的基于 ssl 的 tcp 连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/56002541/

相关文章:

go - 执行 : "cksum": executable file not found in $PATH in golang

go - golang中如何设置应用程序图标?

c - TCP套接字不接收c中的数据

SSL/TLS 握手之前或之后

ssl - 调用 fetchgit 而不进行 SSL 验证

ssl - Apache kafka 2.0.0 版本 - 由于 : SSL handshake,连接到节点 1 的身份验证失败

c++ - boost/asio/ssl 抛出 "undefined reference"错误

iOS 推送通知 SSL 证书

multithreading - 合并 channel 中的项目

TCP 连接生命周期