在Linux Docker容器中运行时无法读取证书-适用于Windows

时间:2019-01-25 03:16:31

标签: c# linux docker .net-core x509certificate2

我正在尝试从SSL证书中读取信息(在这种情况下,我已经通过Chrome保存了StackOverflow的副本),但是由于某种原因,当我在Linux Docker容器中构建并运行它时,它失败了输出任何东西。

在Windows上,输出是我期望的:

S
*.stackexchange.com
stackexchange.com
stackoverflow.com
*.stackoverflow.com
stackauth.com
sstatic.net
*.sstatic.net
serverfault.com
*.serverfault.com
superuser.com
*.superuser.com
stackapps.com
openid.stackauth.com
*.meta.stackexchange.com
meta.stackexchange.com
mathoverflow.net
*.mathoverflow.net
askubuntu.com
*.askubuntu.com
stacksnippets.net
*.blogoverflow.com
blogoverflow.com
*.meta.stackoverflow.com
*.stackoverflow.email
stackoverflow.email
stackoverflow.blog
E

但是Docker容器上同一应用程序的输出如下:

S
E

这是我的代码:

const string ALT_NAME_KEY = "Subject Alternative Name";
string certificateData = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlJUERDQ0J5U2dBd0lCQWdJUUIyWEdUblRsa2RhQU9jb3FoSFZqOERBTkJna3Foa2lHOXcwQkFRc0ZBREJ3DQpNUXN3Q1FZRFZRUUdFd0pWVXpFVk1CTUdBMVVFQ2hNTVJHbG5hVU5sY25RZ1NXNWpNUmt3RndZRFZRUUxFeEIzDQpkM2N1WkdsbmFXTmxjblF1WTI5dE1TOHdMUVlEVlFRREV5WkVhV2RwUTJWeWRDQlRTRUV5SUVocFoyZ2dRWE56DQpkWEpoYm1ObElGTmxjblpsY2lCRFFUQWVGdzB4T0RFd01EVXdNREF3TURCYUZ3MHhPVEE0TVRReE1qQXdNREJhDQpNR294Q3pBSkJnTlZCQVlUQWxWVE1Rc3dDUVlEVlFRSUV3Sk9XVEVSTUE4R0ExVUVCeE1JVG1WM0lGbHZjbXN4DQpIVEFiQmdOVkJBb1RGRk4wWVdOcklFVjRZMmhoYm1kbExDQkpibU11TVJ3d0dnWURWUVFEREJNcUxuTjB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wdmc2N3NKOGd1TjgxcGFwdXBZDQoydjc4RmN2UjhqMEVMZmd5ZWh0V3BqRjN2ektTcS9yWTJzTVhUWXpTUHFNZWtzc2VITmhTTVlVNld3OWg5cHlNDQphVm53OXZhaHFmN25LSEhjQzJWUlRVZ2tRZm45eURtbUJPbzBuUThYZ2ZwZDY1L1BheFZmQm51S2ZFa1hCZnBNDQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tDQo=";
var secretData = Convert.FromBase64String(certificateData);
string[] urls = null;
using (var cert = new X509Certificate2(secretData))
{
    urls = cert.Extensions
        .OfType<X509Extension>()
        .Where(e => e.Oid.FriendlyName == ALT_NAME_KEY)
        .Select(e => new AsnEncodedData(e.Oid, e.RawData))
        .Append(new AsnEncodedData(cert.SubjectName.Oid, cert.SubjectName.RawData))
        .Select(d => d.Format(true))
        .SelectMany(d => Regex.Matches(d, "\\b(?:CN|DNS Name)=(?<domain>.*)(?:\\b|$)").OfType<Match>().Where(m => m.Success).Select(m => m.Groups["domain"].Value))
        .Distinct()
        .ToArray();
}

Console.WriteLine("S");
foreach (var r in urls)
{
    Console.WriteLine(r);
}
Console.WriteLine("E");

这是.NET Core(2.2)中的错误,还是在Linux下需要以不同的方式读取证书?

2 个答案:

答案 0 :(得分:5)

因此,看来主要问题是双重的:

  1. “主题备用名称”的“友好名称”因操作系统而异。
  2. 格式化的字符串因操作系统而异。

Windows:

Friendly name: "Subject Alternative Name"
Formatted data:
    DNS Name=*.stackexchange.com
    DNS Name=stackexchange.com
    DNS Name=stackoverflow.com
    DNS Name=*.stackoverflow.com
    DNS Name=stackauth.com
    DNS Name=sstatic.net
    DNS Name=*.sstatic.net
    DNS Name=serverfault.com
    DNS Name=*.serverfault.com
    DNS Name=superuser.com
    DNS Name=*.superuser.com
    DNS Name=stackapps.com
    DNS Name=openid.stackauth.com
    DNS Name=*.meta.stackexchange.com
    DNS Name=meta.stackexchange.com
    DNS Name=mathoverflow.net
    DNS Name=*.mathoverflow.net
    DNS Name=askubuntu.com
    DNS Name=*.askubuntu.com
    DNS Name=stacksnippets.net
    DNS Name=*.blogoverflow.com
    DNS Name=blogoverflow.com
    DNS Name=*.meta.stackoverflow.com
    DNS Name=*.stackoverflow.email
    DNS Name=stackoverflow.email
    DNS Name=stackoverflow.blog

Docker中的Linux(显然是Mac):

Friendly name: "X509v3 Subject Alternative Name"
Formatted data:
    DNS:*.stackexchange.com, DNS:stackexchange.com, DNS:stackoverflow.com, DNS:*.stackoverflow.com, DNS:stackauth.com, DNS:sstatic.net, DNS:*.sstatic.net, DNS:serverfault.com, DNS:*.serverfault.com, DNS:superuser.com, DNS:*.superuser.com, DNS:stackapps.com, DNS:openid.stackauth.com, DNS:*.meta.stackexchange.com, DNS:meta.stackexchange.com, DNS:mathoverflow.net, DNS:*.mathoverflow.net, DNS:askubuntu.com, DNS:*.askubuntu.com, DNS:stacksnippets.net, DNS:*.blogoverflow.com, DNS:blogoverflow.com, DNS:*.meta.stackoverflow.com, DNS:*.stackoverflow.email, DNS:stackoverflow.email, DNS:stackoverflow.blog

为解决问题1,我开始使用 value 而不是友好名称:2.5.29.17

要解决问题2,我必须对我的正则表达式稍作更新。尽管它对于多行数据(Windows)可以正常工作,但对于Linux / Mac逗号分隔的数据却不能很好地工作。

新表达式现在为:((DNS:|DNS Name=|CN=)(?<domain>.*?),?(?=\s|$))+

将它们放在一起,我们得到:

const string ALT_NAME_VALUE = "2.5.29.17";
string certificateData = "LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tDQpNSUlJUERDQ0J5U2dBd0lCQWdJUUIyWEdUblRsa2RhQU9jb3FoSFZqOERBTkJna3Foa2lHOXcwQkFRc0ZBREJ3DQpNUXN3Q1FZRFZRUUdFd0pWVXpFVk1CTUdBMVVFQ2hNTVJHbG5hVU5sY25RZ1NXNWpNUmt3RndZRFZRUUxFeEIzDQpkM2N1WkdsbmFXTmxjblF1WTI5dE1TOHdMUVlEVlFRREV5WkVhV2RwUTJWeWRDQlRTRUV5SUV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3VUFBNElCQVFBQWs4NzMvKzJRc3dLZkpTUW4raVplDQpaYzh1aUdnOTlwbWQwMDhFMmNtR0VycU56UGNsSzlJTmJQand4bDl6SWdUY1hwRi9VdEJWVlMxWjdYbzgzcWZzDQpHTVBkTXpZdDNGK2hRcFFZTGhsR0YrNUpmMng2WmIxempUL2FNM0dNZEdpKzZPUFYrWUhsL3dnVWU0NU42a1J1DQpEWm5WTDE2NytXM2wybkQrbVNoTy83eHF3SGladXowR0h5QkhScDVpNDNibEgwdmc2N3NKOGd1TjgxcGFwdXBZDQoydjc4RmN2UjhqMEVMZmd5ZWh0V3BqRjN2ektTcS9yWTJzTVhUWXpTUHFNZWtzc2VITmhTTVlVNld3OWg5cHlNDQphVm53OXZhaHFmN25LSEhjQzJWUlRVZ2tRZm45eURtbUJPbzBuUThYZ2ZwZDY1L1BheFZmQm51S2ZFa1hCZnBNDQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tDQo=";
var secretData = Convert.FromBase64String(certificateData);
string[] urls = null;

var tmp = new X509Certificate2Collection();
tmp.Import(secretData);
var cert = tmp.OfType<X509Certificate2>().FirstOrDefault();
urls = cert.Extensions
    .OfType<X509Extension>()
    .Where(e => e.Oid.Value == ALT_NAME_VALUE)
    // I removed the part appending the original subject because I realise the same
    // information is available in the SAN object, so it was just duplicating data
    // this also allowed me to combine Format with creating the AsnEncodedData object
    .Select(e => new AsnEncodedData(e.Oid, e.RawData).Format(true))
    .SelectMany(d => Regex.Matches(d, "((DNS:|DNS Name=|CN=)(?<domain>.*?),?(?=\\s|$))+").OfType<Match>().Where(m => m.Success).Select(m => m.Groups["domain"].Value))
    .Distinct()
    .ToArray();

Console.WriteLine("S");
foreach (var r in urls)
{
    Console.WriteLine(r);
}
Console.WriteLine("E");

现在Windows和Linux上的输出相同:

S
*.stackexchange.com
stackexchange.com
stackoverflow.com
*.stackoverflow.com
stackauth.com
sstatic.net
*.sstatic.net
serverfault.com
*.serverfault.com
superuser.com
*.superuser.com
stackapps.com
openid.stackauth.com
*.meta.stackexchange.com
meta.stackexchange.com
mathoverflow.net
*.mathoverflow.net
askubuntu.com
*.askubuntu.com
stacksnippets.net
*.blogoverflow.com
blogoverflow.com
*.meta.stackoverflow.com
*.stackoverflow.email
stackoverflow.email
stackoverflow.blog
E

答案 1 :(得分:4)

由于Nkosi将我指向this answer,因此我能够使用PeNet提取证书URL:

termios

import termios的外观

${shlibs:Depends}

我知道,到目前为止,展平所有节点可能不是最有效的方法,但就我而言,性能并不是很重要。它只是检验证书少数在Kubernetes集群作为日常cron作业。

我很想知道,如果有可能没有一个第三方库,特别是因为它是在Windows上。