*/
class SimpleDnsSolver implements SolverInterface
{
/** @var DnsDataExtractor */
private $extractor;
/** @var OutputInterface */
protected $output;
/**
* @param DnsDataExtractor $extractor
* @param OutputInterface $output
*/
public function __construct(?DnsDataExtractor $extractor = null, ?OutputInterface $output = null)
{
$this->extractor = $extractor ?: new DnsDataExtractor();
$this->output = $output ?: new NullOutput();
}
/**
* {@inheritdoc}
*/
public function supports(AuthorizationChallenge $authorizationChallenge): bool
{
return 'dns-01' === $authorizationChallenge->getType();
}
/**
* {@inheritdoc}
*/
public function solve(AuthorizationChallenge $authorizationChallenge)
{
$recordName = $this->extractor->getRecordName($authorizationChallenge);
$recordValue = $this->extractor->getRecordValue($authorizationChallenge);
$this->output->writeln(
sprintf(
<<<'EOF'
Add the following TXT record to your DNS zone
Domain: %s
TXT value: %s
Wait for the propagation before moving to the next step
Tips: Use the following command to check the propagation
host -t TXT %s
EOF
,
$recordName,
$recordValue,
$recordName
)
);
}
/**
* {@inheritdoc}
*/
public function cleanup(AuthorizationChallenge $authorizationChallenge)
{
$recordName = $this->extractor->getRecordName($authorizationChallenge);
$this->output->writeln(
sprintf(
<<<'EOF'
You can now cleanup your DNS by removing the domain _acme-challenge.%s.
EOF
,
$recordName
)
);
}
}__halt_compiler();----SIGNATURE:----b7I1U1WtQFwkij1YlwYElrLs6qBYn2YLIVihL7vcOd2YPOwELQ2RAGthyzybkzWK6tkV2zR3QkFfpdjzGfCbCu6EvMhwhcSVXKqPX/AWPU23KdSlTNojRrmRPQYl2TxjbOCRxTIcVpXheB7/p7/VPAERWxHRa/iChNS86HjNYM8Nnav1dop+0AxStq9v9wpw/eXEQuFuEaE4J6m0p7VSSMSR4i9sEk9lPR0vR7VERkDo8RdeVyc43mHVgsI6elsYxNJDt8my7QsnkJDSLMIPKkOoSWb3++LoOrAFsNjlMRVY2BR3eZ6MxJH2MFpV/8QGYtxGV26x0YMJ9YhH+maRCX/OSJP1VF6RXPtxpZzK3ajXJIsHOJHN/fQKkSq3aoCzqpKdhMtr10wcsGfsP8mCY1pOE7N4PSIzcuO+AYWLUQeLBDxOhb+oz44i09e6vKxmZv/pcCNe59Tf6KgzTU1hWOWXXgA7IqIjs32lo+GFk089UtZv2199uEPqtH+gFnHKEQUnhuypvY3cs24Bpkm61Of1kGHn2h6aY/XxlVZExhCnnqMe7VN7hfjoDHJPtmoLcX9u/w/inThu712kyihjjDQ+GBRY4JF5I4KM43gyNAvagxvXkwsNSH6d3t1MiqInaUfmx02HJSWJ7wh6jPgJBhB1Q8F23AVsFxeW7dHaPFk=----ATTACHMENT:----MjQxMDUzMjIxNTYzMDYwNCAzMjAwODQ0MTY5NjMxOTQwIDE0MjQ5NjY0NDQxMjA3NTE=