通过以下方式连接到远程gdbserver之后:
target remote server:8888
Run Code Online (Sandbox Code Playgroud)
要么
target extended-remote server:8888
Run Code Online (Sandbox Code Playgroud)
继续使用CTRL + c后,无法暂停调试器.在同一个PID上的本地gdb会话中执行相同操作.尝试调试附加到其他进程(如vim)的远程gdbserver,例如CTRL + c也可以.
我尝试了不同的组合
handle SIGINT stop noprint nopass
Run Code Online (Sandbox Code Playgroud)
但它没有帮助.
暂停调试器的唯一方法是
kill -SIGTRAP $(pgrep -f my_app)
Run Code Online (Sandbox Code Playgroud)
在远程主机上.
$ gdb
target extended-remote localhost:8888
Remote debugging using localhost:8888
Reading /lib64/libdl.so.2 from remote target...
Reading /lib64/libSegFault.so from remote target...
...
Reading /lib64/ld-linux-x86-64.so.2 from remote target...
0x00007f6b26857923 in __select_nocancel () from target:/lib64/libc.so.6
(gdb) where
#0 0x00007f6b26857923 in __select_nocancel () from target:/lib64/libc.so.6
...
#9 0x00000000004497ee in main (argc=14, argv=0x7ffe8e4b0af8) at main.cpp:245
(gdb) c
Continuing.
^C^CThe …Run Code Online (Sandbox Code Playgroud) 我们喜欢使用客户端证书身份验证而不是基本身份验证来访问网络服务器。
证书是 PEM 证书,密钥文件是单独的文件。
curl 调用如下所示:
curl -v --cert cert.crt --key key.key --pass foobar https://testserver/soap/request
Run Code Online (Sandbox Code Playgroud)
从调试日志:
HTTP/1.1 401 Unauthorized
X-message-code: PWD_WRONG
WWW-Authenticate: Basic realm="Test Platform"
Transfer-Encoding: chunked
Date: Wed, 30 May 2018 10:26:51 GMT
Server: TEST
Set-Cookie: ...
Run Code Online (Sandbox Code Playgroud)
我了解到 WWW-Authenticate: Basic 是从服务器到客户端提供基本身份验证的请求。但是对于未经身份验证的请求可能会发生这种情况,因此它不能证明服务器不提供证书身份验证。
阅读https://medium.com/@sevcsik/authentication-using-https-client-certificates-3c9d270e8326 ...作为双重检查,我尝试使用 Firefox 浏览器将两个文件合并为 PKCS#12 格式并将其导入浏览器。它可以工作,因此服务器支持证书身份验证。
失败的 curl 调用有什么问题?是否有任何支持证书认证的测试服务器?https://www.httpbin.org/似乎没有提供该设置。
使用带有 curl 的 PKCS#12 版本时会发生相同的错误,如下所示:
curl -v --cert cert.p12 --cert-type p12 --pass foobar
https://testserver/soap/request...
Run Code Online (Sandbox Code Playgroud)
完整的调试日志:
* Uses proxy env variable no_proxy == '10.0.0.0/8,127.0.0.1,172.16.0.0/12,192.168.20.0/24,'
* Uses proxy …Run Code Online (Sandbox Code Playgroud)