Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ssl/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ read\u keycert函数在哪个头文件中定义_C++_Ssl_Grpc - Fatal编程技术网

C++ read\u keycert函数在哪个头文件中定义

C++ read\u keycert函数在哪个头文件中定义,c++,ssl,grpc,C++,Ssl,Grpc,我正在尝试解决这个问题 将SSL添加到gRPC Helloworld示例中,但由于找不到read_keycert函数,因此无法编译该示例(“read_keycert”未在此范围内声明) 我需要包含哪些头文件?基于此站点的文档设置。我想,read\u keycert只是一个自定义函数,用于读取.key文件的内容并将其存储在字符串中 std::string read_ketcert(const char* filename) { std::ifstream file(filename);

我正在尝试解决这个问题

将SSL添加到gRPC Helloworld示例中,但由于找不到read_keycert函数,因此无法编译该示例(“read_keycert”未在此范围内声明)


我需要包含哪些头文件?

基于此站点的文档设置。我想,
read\u keycert
只是一个自定义函数,用于读取.key文件的内容并将其存储在字符串中

std::string read_ketcert(const char* filename)
{
     std::ifstream file(filename);
     std::string temp;
     std::getline(file, temp);
     file.close();
     return temp;
}
注意:此函数仅读取.key或.cert文件中的一行或单行

将此添加到您的程序中,程序应该可以正常编译