Debugging SSL on Linux
Debugging SSL on Linux
To help anyone looking at the SSL code, here are a few tips I've found handy.
Contents
Logging
There are several flavors of logging you can turn on.
-
SSLClientSocketImpl
can log its state transitions and function calls usingbase/logging.cc
. To enable this, editnet/socket/ssl_client_socket_impl.cc
and change#if 1
to#if 0
. Seebase/logging.cc
for where the output goes (on Linux, usually stderr). -
HttpNetworkTransaction
and friends can log its state transitions usingbase/trace_event.cc
. To enable this, arrange for your app to callbase::TraceLog::StartTracing()
. The output goes to a file namedtrace...pid.log
in the same directory as the executable (e.g.Hammer/trace_15323.log
).
Network Traces
http://wiki.wireshark.org/SSL describes how to decode SSL traffic. Chromium SSL unit tests that use net/base/ssl_test_util.cc
to set up their servers always use port 9443 with net/data/ssl/certificates/ok_cert.pem
, and port 9666 with net/data/ssl/certificates/expired_cert.pem
This makes it easy to configure Wireshark to decode the traffic: do
Edit / Preferences / Protocols / SSL, and in the “RSA Keys List” box, enter
127.0.0.1,9443,http,<path to ok_cert.pem>;127.0.0.1,9666,http,<path to expired_cert.pem>
e.g.
127.0.0.1,9443,http,/home/dank/chromium/src/net/data/ssl/certificates/ok_cert.pem;127.0.0.1,9666,http,/home/dank/chromium/src/net/data/ssl/certificates/expired_cert.pem
Then capture all tcp traffic on interface lo, and run your test.
相关文章
- ARM on Linux:架构创新之旅(arm跑linux)
- 安装sbt on Linux:简单易行(sbt安装linux)
- Linux查看防火墙状态的简单操作(linux怎么查看防火墙状态)
- Linux下解压WAR文件的方法(linux解压war文件)
- Fast Data Decompression:LZ4 on Linux(lz4解压linux)
- Linux下实现定时自动任务的核心文件 (linux计划任务文件)
- Linux 目录可用空间测量(linux目录剩余空间)
- Linux安装Lynx:打造简单可靠的网络世界(linux安装lynx)
- 快速掌握Linux的搜索关键词(linux搜索关键词)
- Linux手动FTP自动传输操作(linux自动ftp)
- Linux下du命令使用介绍(linux下du)
- 揭秘Linux嵌入式开发待遇:薪资、福利等你来了解!(linux嵌入式开发待遇)
- Exploring the Benefits of VM on a Linux System(linux系统vm)
- Get the Time on Linux: A Quick Guide to Querying Current Time(linux查询当前时间)
- StepbyStep Guide: Installing and Configuring SVN on Linux(linux安装配置svn)
- StepbyStep Guide to Configuring a Network Bridge on Linux Systems(linux系统下配置网桥)
- Linux环境依赖安装包至关重要(linux依赖安装包)
- Linux下Gvfs助力数据安全性(linux gvfs)
- 优化指南:如何提升Linux系统的锁性能(linux锁性能)
- 探索Linux世界:查看SSL版本(linux查看ssl版本)
- Debugging PHP with Xdebug on Linux System(xdebug linux)
- 原子操作的Linux:默默改变着IT业的世界(atomic linux)
- 一步步教你如何在Linux上安装QT4(linux安装qt4教程)