小编hzr*_*ari的帖子

curl:(58)无法加载客户端密钥-8178

我正面临着该curl命令的SSL问题.我想使用我的SSL客户端证书和私钥来访问URL.

这是我的命令:

$ curl -k -v "https://myurl.com/" --cert ./certificate.pem --key ./private.key

* About to connect() to xx.xx.xx.xx port 23444 (#0)
*   Trying xx.xx.xx.xx... connected
* Connected to xx.xx.xx.xx (xx.xx.xx.xx) port 23444 (#0)
* Initializing NSS with certpath: sql:/etc/pki/nssdb
* warning: ignoring value of ssl.verifyhost
* Unable to load client key -8178.
* NSS error -8178
* Closing connection #0
curl: (58) Unable to load client key -8178.
Run Code Online (Sandbox Code Playgroud)

密钥是密码保护的,curl不要求我输入密码,这很奇怪.即使我传递了密码--pass,我仍然会得到同样的错误.

似乎--key没有考虑参数,因为如果我替换了foo.key,我的文件系统上不存在,我仍然得到相同的错误.

但是,如果使用: …

ssl curl client-server

24
推荐指数
1
解决办法
4万
查看次数

在Mpeg流中插入用户数据

有没有办法在MPEG流中插入用户数据(起始码= 0X1B2)?我正在寻找的是一个简单的工具,脚本或使用和Hex编辑器的一些技巧...

或者你可能有一个ffmpeg(libavcodec和libavformat)补丁允许这样做?

mpeg ffmpeg user-data libavcodec

5
推荐指数
1
解决办法
968
查看次数

传递包含C和C#之间结构数组的结构(DLL和P调用)

我有一个复杂的结构C dll我真的是C#的新手:

typedef struct {
    int a;
    int b;
} simple_struct;

typedef struct {
    int d;
    int e;
    simple_struct f[20];
    short g;
    simple_struct h[20];
    short i;
} complex_struct;
Run Code Online (Sandbox Code Playgroud)

问题是我无法使用这种结构连接我的C#应用​​程序!

在DLL中有一个函数Ge​​tData(complex_struct*myStruct),我应该从C#中调用它,所以我创建了:

    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    unsafe struct simple_struct {
        public int a;
        public int b;
    } ;

    [StructLayout(LayoutKind.Sequential, Pack = 1)]
    unsafe struct complex_struct {
        public int d;
        public int e;
        public simple_struct[] f;
        public short g;
        public simple_struct[] h;
        public short i;
    } ;
Run Code Online (Sandbox Code Playgroud)

但问题是,当我将complex_struct作为GetData的参数传递时,所有字段都从我身上填充,但不是我的两个simple_struct数组(我的意思是f和h)!他们的价值观无效!

谢谢,有人可以帮助我


嗨,谢谢你的回复,

我已经像你说的那样做了,但是当我调用GetData时仍然有另一个问题,进程崩溃而没有任何消息(一种异常):

这是我的急剧代码:namespace dll_test_import_c_sharp …

c c# arrays dll structure

4
推荐指数
1
解决办法
2649
查看次数

标签 统计

arrays ×1

c ×1

c# ×1

client-server ×1

curl ×1

dll ×1

ffmpeg ×1

libavcodec ×1

mpeg ×1

ssl ×1

structure ×1

user-data ×1