From 91a0866fdced1d7b5741b31f0ef2556dfce1d6a5 Mon Sep 17 00:00:00 2001 From: terrafrost Date: Tue, 7 Mar 2017 21:29:35 -0600 Subject: [PATCH] Tests/X509: add unit test for issue involving multiple domain names --- tests/Unit/File/X509/X509Test.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/Unit/File/X509/X509Test.php b/tests/Unit/File/X509/X509Test.php index 3b88161c..99e09397 100644 --- a/tests/Unit/File/X509/X509Test.php +++ b/tests/Unit/File/X509/X509Test.php @@ -454,4 +454,30 @@ Mj93S runkit_constant_remove('FILE_X509_IGNORE_TYPE'); } + + // fixed by #1104 + public function testMultipleDomainNames() + { + $keyGenerator = new RSA(); + $keys = $keyGenerator->createKey(512); + + $privateKey = new RSA(); + $privateKey->loadKey($keys['privatekey']); + + $publicKey = new RSA(); + $publicKey->loadKey($keys['publickey']); + $publicKey->setPublicKey(); + + $subject = new X509(); + $subject->setDomain('example.com', 'example.net'); + + $subject->setPublicKey($publicKey); + + $issuer = new X509(); + $issuer->setPrivateKey($privateKey); + $issuer->setDN($subject->getDN()); + + $x509 = new X509(); + $x509->sign($issuer, $subject); + } }