verify-cn

来自「OpenVPN is a robust and highly flexible 」· 代码 · 共 24 行

TXT
24
字号
#!/usr/bin/perl# Verify X509 Common Name## Return 0 if cn matches the common name component of X509_NAME_oneline,# 1 otherwise.## For example in openvpn, you could use the option:#  --tls-verify "./verify-cn Test-Client"die "usage: verify-cn cn certificate_depth X509_NAME_oneline" if (@ARGV != 3);($cn, $depth, $x509) = @ARGV;if ($depth == 0) {    if ($x509 =~ /\/CN=([^\/]+)/) {	if ($cn eq $1) {	    exit 0;	}    }    exit 1;}exit 0;

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?