代码之家  ›  专栏  ›  技术社区  ›  Mathieu K.

为SubjectAltName中的多个域生成带绿锁的SSL证书

  •  0
  • Mathieu K.  · 技术社区  · 7 年前

    我使用greenlock生成证书,我向它传递了三个域,在我的altnames中只得到2个域:

    const greenlock = Greenlock.create({
      agreeTos: true,
      email: myemail,
      communityMember: false,
      version: 'draft-12',
      server: 'https://acme-v02.api.letsencrypt.org/directory',
      configDir: '/etc/letsencrypt',
      debug: true,
      log: (debug) => { console.log(debug) },
    })  
    console.log({ domains })
    return greenlock.register({
          domains,
          email: myemail,
          challengeType: 'dns-01',
        })
    .then((result) => {
        console.log(result)
    })
    

    { domains:
     [ 'domain1',
       'domain3',
       'domain2' ] }
    true
    true
    true
    { result:
    { 
      privkey: '-----BEGIN PRIVATE KEY-----\n\n-----END CERTIFICATE-----\n',    
      chain:  '-----BEGIN CERTIFICATE-----\n-----END CERTIFICATE-----\n',
      subject: 'domain2',
      altnames: [ 'domain1', 'domain2' ],
      _issuedAt: 2018-09-19T14:43:31.000Z,
      _expiresAt: 2018-12-18T14:43:31.000Z,
      issuedAt: 1537368211000,
      expiresAt: 1545144211000 } }
    

    正如您所看到的,甚至不是我的前两个域最终出现在我的altnames中,而是那些已经出现在旧证书中的域(不确定这是为什么)。

    我尝试将ApprovedDomains传递给我的greenlock构造函数,但似乎没有太大变化。 我的证书中仍然没有列出我的新域(domain2):

    openssl x509 -text < /etc/letsencrypt/live/domain1/fullchain.pem  | grep 'DNS:' | sed 's/\s*DNS:\([a-z0-9.\-]*\)[,\s]\?/\1 /g'
    
    domain1 domain3
    
    0 回复  |  直到 7 年前
        1
  •  2
  •   coolaj86    7 年前

    使用 Greenlock 版本2.7+

    所有与证书生成、域名和域名关联相关的代码都已更新。

    另外,有关证书的信息直接从证书中读取,因此“缓存”和“真相”之间不能不匹配。

    如果您遇到进一步的问题,请直接通知我们:

    推荐文章