具有SSL的连接器/C ++? [英] Connector/c++ with SSL?

查看:140
本文介绍了具有SSL的连接器/C ++?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何通过SSL使用Connector/c ++连接到MySql?

我读到有关mysql_ssl_set()的信息:似乎仅适用于Connector/c.

我启用了openSSL,并在MySql上为需要SSL的用户工作.而且我可以使用Connector/c ++远程连接到MySql,但是看不到如何修改sql :: Connection的参数以引用SSL的参考证书.

来自MySql DevZone的Giri Mandalika的出色教程以及关于Connector/c ++的文档都没有提到SSL,这使我感到惊讶,因为SSL对于Connector/c已有很好的文档记载了……还是我错过了明显的东西?

我意识到sql :: Driver :: Connect()已重载,而鲜为人知的讨论方法采用一个参数sql :: ConnectOptionsMap& options.在那条线索之后,我只找到了一个要点:Ulf Wendel/Thomas Pollak问题与解答在这里(http://forums.mysql.com/read.php?167,367519,369534#msg-369534). /p>

对我不起作用:当我将其合并并尝试进行构建(VC2008,WIN7)时,该构建出现了警告,但失败了.

我追查出确切原因为: sql :: ConnectPropertyVal生成本地定义的符号警告;和 std :: map导致致命错误LNK1120:1个未解决的外部组件.

有这么多的Connector/c ++用户,我希望社区中的其他人也可能对如何将SSL与Connector/c ++一起使用感兴趣.感谢任何想法或帮助.

解决方案

向Giri Mandalika(原始开发团队)致意,他提到SSL支持最初是计划中的,但尚未完成对Connector/c ++的支持.

如果其他想要SSL的人发现了这个问题,我只能通过使用Connector/c(Connector/C ++旨在包装该C的基础C api)来解决该问题.

由于六个多月过去了,没有任何社区成员提出使用SSL与Connector/c ++结合使用的特定解决方案(我的问题中引用的过载解决方案除外),我想我不得不得出结论,那就是不可能,然后将我自己的问题标记为已回答".

How to connect to MySql using Connector/c++ over SSL?

I read about mysql_ssl_set(): seems to work only with Connector/c.

I have openSSL enabled and working for require SSL users on MySql. And I can connect remotely to MySql using Connector/c++, but cannot see how to modify parameters of sql::Connection to reference certs for SSL.

Excellent tutorial from Giri Mandalika at MySql DevZone and docs on Connector/c++ don't mention SSL, which surprised me because SSL is well documented for Connector/c...or did I miss something obvious?

I realize sql::Driver::Connect() is overloaded, with the less-commonly discussed method taking one parameter sql::ConnectOptionsMap &options. Following that trail, I found just one discussion on point: Ulf Wendel/Thomas Pollak question-and-solution here (http://forums.mysql.com/read.php?167,367519,369534#msg-369534).

Did not work for me: when I incorporated it and tried to build (VC2008, WIN7) the build had warnings and failed.

I traced the exact causes as: sql::ConnectPropertyVal generates locally defined symbol warning; and std::map causes fatal error LNK1120: 1 unresolved externals.

With so many users out there of Connector/c++, I hoped others in the community might also be interested in how to use SSL with Connector/c++. Appreciate any ideas or help.

解决方案

Spoke to Giri Mandalika (on the original development team), who mentioned that SSL support was originally planned but not completed for Connector/c++.

In case others who want SSL find this question, I worked around the problem only by using Connector/c, the underlying C api which Connector/C++ was designed to wrap.

As more than six months have elapsed without any community member coming up with a specific solution to use SSL with Connector/c++ (other than the overload solution referenced in my question), I guess I have to conclude that it just isn't possible, and mark my own question as "Answered" by me.

这篇关于具有SSL的连接器/C ++?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆