Skip to content

Conversation

@xiaohuilam
Copy link

No description provided.

@xiaohuilam xiaohuilam added the documentation Improvements or additions to documentation label Jul 30, 2019
@digitalsign digitalsign locked as off-topic and limited conversation to collaborators Jul 30, 2019
@xiaohuilam xiaohuilam added the wontfix This will not be worked on label Jul 30, 2019
Copy link
Author

@xiaohuilam xiaohuilam left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

comment all changes

*/
class AuthorizeCommand extends AbstractCommand
{
use KeyOptionCommandTrait;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为 csrEager 需要生成 KEY

->setDefinition([
new InputOption('solver', 's', InputOption::VALUE_REQUIRED, 'The type of challenge solver to use (available: http, dns, route53)', 'http'),
new InputArgument('domains', InputArgument::IS_ARRAY | InputArgument::REQUIRED, 'List of domains to ask an authorization for'),
new InputOption('country', null, InputOption::VALUE_REQUIRED, 'Your country two-letters code (field "C" of the distinguished name, for instance: "US")'),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为 csrEager 参数需要

$solver = $solverLocator->get($solverName);
$this->debug('Solver found', ['name' => $solverName]);

$alternativeNames = $domains;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

生成 CSR 的逻辑. 初始化订单时候一起提交

throw $e;
}
}

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

挪到 Trait 和 initializeOrder 方法共用

$client = $this->getClient();
$domains = array_unique(array_merge([$domain], $domainConfig['subject_alternative_names']));


Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

生成 CSR

{
Assert::allStringNotEmpty($domains, 'requestOrder::$domains expected a list of strings. Got: %s');

$humanText = ['-----BEGIN CERTIFICATE REQUEST-----', '-----END CERTIFICATE REQUEST-----'];
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

将 CSR 内容转换成 UrlSafe

$response['url'],
$response['token'],
$response['token'].'.'.$base64encoder->encode($this->getHttpClient()->getJWKThumbprint())
isset($response['filecontent']) ? $response['filecontent'] : ($response['token'].'.'.$base64encoder->encode($this->getHttpClient()->getJWKThumbprint())),
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为 trustocean (comodoca) 的验证路径/文件名/内容不一致. 特意加上的补充参数

{
return sprintf(
'/.well-known/acme-challenge/%s',
$authorizationChallenge->getPath() ? ($authorizationChallenge->getPath() . '%s') : '/.well-known/acme-challenge/%s',
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/.well-known/acme-challenge/ => /.well-known/pki-validation/


public function delete($path)
{
return;
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

keep un-deleted. because when program run here, comodo is not verified for certain yet.

* @param string $filecontent
*/
public function __construct($domain, $status, $type, $url, $token, $payload)
public function __construct($domain, $status, $type, $url, $token, $payload, $path = null, $verifyurl = null, $filecontent = null)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

文件内容/路径/文件名有特殊要求

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

documentation Improvements or additions to documentation wontfix This will not be worked on

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants