小编use*_*372的帖子

无法设置私钥文件:'./ cert.pem'类型为PEM

我使用curl使用公共证书文件从https站点下载数据.

系统信息:

  • 操作系统: fedora 14
  • 卷曲:卷曲7.30.0
  • openssl: OpenSSL 1.0.0a-fips

命令是,

curl -v "https://<ip:<port>" --cert "./cert.pem" --cacert "./cacert.pem" --cert-type PEM
* About to connect() to kng.com port 443 (#0)
*   Trying 11.19.37.123...
* Adding handle: conn: 0x8189e68
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x8189e68) send_pipe: 1, recv_pipe: 0
* Connected to fkng.com (11.19.37.123) port 443 (#0)
* unable to set private key file: './cert.pem' type PEM
* Closing …
Run Code Online (Sandbox Code Playgroud)

curl openssl

23
推荐指数
3
解决办法
8万
查看次数

使用"C"执行API将sqlite3表导出到文件中

我在fedora 14中使用sqlite3版本3.6.23.1.我能够使用这样的命令提示符将表导出到文件中,

sqlite3 data.db

sqlite> .output sample.txt;

sqlite> select *from sample;
Run Code Online (Sandbox Code Playgroud)

我想在应用程序级别处理此案例.

我正在使用sqlite3开源"C"API在应用程序级别执行此命令.

execute("delete from sample:);// working fine

execute(".output sample.txt"); //Not working
Run Code Online (Sandbox Code Playgroud)

它的投掷错误叫做 "SQL error in sqlite3_exec: near ".": syntax error"

请建议我如何使用此API创建文件以导入数据.

API的功能定义.

int execute(const char* fmt, ...)
{

    char *err_messg;

    int ret = 0, result = 0;

    char sql_string[1024] = ""; //this honestly needs to be more elegant; will do for now

    va_list args;

    va_start(args, fmt);

    ret = vsprintf(sql_string, fmt, args);

    va_end(args);

    printf("sql_string: %s\n", sql_string);

    if (!ret)
        result = …
Run Code Online (Sandbox Code Playgroud)

c sqlite

6
推荐指数
2
解决办法
4697
查看次数

标签 统计

c ×1

curl ×1

openssl ×1

sqlite ×1