Skip to content

Commit

Permalink
Send correct base64 data to HAProxy
Browse files Browse the repository at this point in the history
  • Loading branch information
SnijderC committed Dec 18, 2017
1 parent 5838009 commit 0f900f4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
5 changes: 1 addition & 4 deletions stapled/core/stapleadder.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
from io import StringIO
from stapled.core.excepthandler import stapled_except_handle
import stapled.core.exceptions
import stapled.util.functions

try:
_ = BrokenPipeError
Expand Down Expand Up @@ -137,9 +136,7 @@ def add_staple(self, model):
:param model: An object that has a binary string `ocsp_staple` in it
and a filename `filename`.
"""
command = self.OCSP_ADD.format(
stapled.util.functions.base64(model.ocsp_staple.raw)
)
command = self.OCSP_ADD.format(model.ocsp_staple.base64)
LOG.debug("Setting OCSP staple with command '%s'", command)
directory = os.path.dirname(model.filename)
response = self.send(directory, command)
Expand Down
5 changes: 5 additions & 0 deletions stapled/util/ocsp.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from builtins import str
import datetime
import asn1crypto
from stapled.util.functions import base64


class OCSPResponseParser(object):
Expand All @@ -22,6 +23,10 @@ def __init__(self, ocsp_object=None):
# SingleResponse object should be in these keys
self.tbsresponse = self.response['responses'][0]

@property
def base64(self):
return base64(self.raw.dump())

@property
def status(self):
"""
Expand Down

0 comments on commit 0f900f4

Please sign in to comment.