"""Tests for certbot_nginx._internal.http_01""" import sys import unittest from unittest import mock import josepy as jose import pytest from acme import challenges from acme import messages from certbot import achallenges from certbot.tests import acme_util from certbot.tests import util as test_util from certbot_nginx._internal.obj import Addr from certbot_nginx._internal.tests import test_util as util AUTH_KEY = jose.JWKRSA.load(test_util.load_vector("rsa512_key.pem")) class HttpPerformTest(util.NginxTest): """Test the NginxHttp01 challenge.""" account_key = AUTH_KEY achalls = [ achallenges.KeyAuthorizationAnnotatedChallenge( challb=acme_util.chall_to_challb( challenges.HTTP01(token=b"kNdwjwOeX0I_A8DXt9Msmg"), messages.STATUS_PENDING), domain="www.example.com", account_key=account_key), achallenges.KeyAuthorizationAnnotatedChallenge( challb=acme_util.chall_to_challb( challenges.HTTP01( token=b"\xba\xa9\xda?