我已经为TLS安全集成了僵尸库。我得到了以下错误:
jsonrpctest.exe: 0xC0000005:访问冲突读取位置0x00962000中0x6DBFD1CE (vcruntime140.dll)的第一次异常。如果存在此异常的处理程序,则可以安全地继续执行该程序。
下面是我调用的代码
int main(int argc, char *argv[])
{
// prepare all the parameters
Callbacks callbacks;
Botan::AutoSeeded_RNG rng;
Botan::TLS::Session_Manager_In_Memory session_mgr(rng);
Client_Credentials creds;
Botan::TLS::Strict_Policy policy;
// open the tls connection : Error comes here
Botan::TLS::Client client(callbacks,
session_mgr,
creds,
policy,
rng,
Botan::TLS::Server_Information("10.193.252.14", 43733),
Botan::TLS::Protocol_Version::TLS_V12);
while (!client.is_closed())
{
//cout << client.is_active;
// read data received from the tls server, e.g., using BSD sockets or
boost asio
// ...
// send data to the tls server using client.send_data()
} }发布于 2017-12-22 12:23:41
造成此错误的确切原因尚不清楚。我想这是一些建筑标志,也许是视觉工作室。我在发布版本中遇到了类似的错误,但在调试版本中运行得很好。然后,我将它构建为一个库(DLL),而不是一个应用程序(.exe),我没有看到任何问题。我认为使用Botan的最好方法是进行合并构建(即不使用Botan库,而是将Botan代码导入应用程序,然后使用它)。下面是为我工作的构建命令(从Botan源文件夹运行它):
configure.py --cpu=i386 --amalgamation --single-amalgamation-file --minimized-build --enable-modules=tls,x509,seed,rdseed,rdrand,rdrand_rng,auto_rng --disable-shared在运行上面的命令之前,需要安装Python和path。上面的命令将在Botan源代码目录中生成以下文件(即运行上述命令的相同路径):
botan_all.h、botan_all_internal.h和botan_all.cpp
您需要将这些文件作为应用程序代码的一部分,使用它并构建它。
关于Botan合并构建的更多信息:https://botan.randombit.net/manual/building.html#amalgamation
https://stackoverflow.com/questions/46903283
复制相似问题