mirror of
https://github.com/certbot/certbot.git
synced 2026-08-01 19:02:52 +02:00
actually check request recipient
This commit is contained in:
@@ -29,8 +29,7 @@ def init(m):
|
|||||||
m.session = ""
|
m.session = ""
|
||||||
|
|
||||||
def make_request(m, csr):
|
def make_request(m, csr):
|
||||||
# TODO: take recipient from os.environ["CHOCOLATESERVER"]
|
m.request.recipient = os.environ["CHOCOLATESERVER"]
|
||||||
m.request.recipient = "ca.example.com"
|
|
||||||
m.request.timestamp = int(time.time())
|
m.request.timestamp = int(time.time())
|
||||||
m.request.csr = csr
|
m.request.csr = csr
|
||||||
|
|
||||||
|
|||||||
@@ -12,6 +12,11 @@ from google.protobuf.message import DecodeError
|
|||||||
MaximumSessionAge = 100 # seconds, to demonstrate session timeout
|
MaximumSessionAge = 100 # seconds, to demonstrate session timeout
|
||||||
MaximumChallengeAge = 600 # to demonstrate challenge timeout
|
MaximumChallengeAge = 600 # to demonstrate challenge timeout
|
||||||
|
|
||||||
|
try:
|
||||||
|
chocolate_server_name = open("SERVERNAME").read().rstrip()
|
||||||
|
except IOError:
|
||||||
|
raise IOError, "Please create a SERVERNAME file containing the server name."
|
||||||
|
|
||||||
urls = (
|
urls = (
|
||||||
'.*', 'session'
|
'.*', 'session'
|
||||||
)
|
)
|
||||||
@@ -217,7 +222,7 @@ class session(object):
|
|||||||
if time.time() - timestamp > 100:
|
if time.time() - timestamp > 100:
|
||||||
self.die(r, r.BadRequest, uri="https://ca.example.com/failures/past")
|
self.die(r, r.BadRequest, uri="https://ca.example.com/failures/past")
|
||||||
return
|
return
|
||||||
if recipient != "ca.example.com":
|
if recipient != chocolate_server_name:
|
||||||
self.die(r, r.BadRequest, uri="https://ca.example.com/failures/recipient")
|
self.die(r, r.BadRequest, uri="https://ca.example.com/failures/recipient")
|
||||||
return
|
return
|
||||||
if not CSR.parse(csr):
|
if not CSR.parse(csr):
|
||||||
|
|||||||
Reference in New Issue
Block a user