File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -5,6 +5,14 @@ All notable changes to this project will be documented in this file.
55The format is based on [ Keep a Changelog] ( http://keepachangelog.com/en/1.0.0/ )
66and this project adheres to [ Semantic Versioning] ( http://semver.org/spec/v2.0.0.html ) .
77
8+ ## [ Unreleased]
9+
10+ ### Added
11+ * New API command: setSslCrt
12+
13+ ### Deprecated
14+ * Deprecate API command: updateSslCrt
15+
816## [ v0.6.1] - 2023-12-05
917
1018### Changed
Original file line number Diff line number Diff line change @@ -259,13 +259,20 @@ class newSslCrt(Cmd):
259259 helpTxt = "Create a new certificate file to be used in a crt-list or a directory."
260260
261261
262- class updateSslCrt (Cmd ):
262+ class setSslCrt (Cmd ):
263263 """" Begin a transaction to upload the certificate into a slot in HAProxy’s memory """
264264 cmdTxt = "set ssl cert %(certfile)s <<\n %(payload)s\r \n "
265265 req_args = ['certfile' , 'payload' ]
266266 helpTxt = "Replace a certificate file."
267267
268268
269+ class updateSslCrt (Cmd ):
270+ """" DEPRECATED. Begin a transaction to upload the certificate into a slot in HAProxy’s memory """
271+ cmdTxt = "set ssl cert %(certfile)s <<\n %(payload)s\r \n "
272+ req_args = ['certfile' , 'payload' ]
273+ helpTxt = "DEPRECATED. Alias for setSslCrt. Kept for compatibility reasons."
274+
275+
269276class delSslCrt (Cmd ):
270277 """" Begin a transaction to remove the certificate from a slot in HAProxy’s memory """
271278 cmdTxt = "del ssl cert %(certfile)s\r \n "
Original file line number Diff line number Diff line change @@ -152,6 +152,7 @@ def setUp(self):
152152 "del-from-crt-list" : ("del ssl crt-list /tmp/haproxy/ssl/601a7392cc9984.99301413.certlist"
153153 " /tmp/haproxy/ssl/601a70e4844b0.pem" ),
154154 "new-ssl-cert" : "new ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem" ,
155+ "set-ssl-cert" : "set ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem <<\n %s" % self .pem_cert_content ,
155156 "update-ssl-cert" : "set ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem <<\n %s" % self .pem_cert_content ,
156157 "del-ssl-cert" : "del ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem" ,
157158 "commit-ssl-cert" : "commit ssl cert /tmp/haproxy/ssl/601a70e4844b0.pem" ,
@@ -258,6 +259,15 @@ def test_newSslCrt(self):
258259 cmdOutput = cmds .newSslCrt (** args ).getCmd ()
259260 self .assertEqual (cmdOutput , self .Resp ["new-ssl-cert" ])
260261
262+ def test_setSslCrt (self ):
263+ """Test 'set ssl cert <certfile> <payload>' command"""
264+ args = {
265+ "certfile" : "/tmp/haproxy/ssl/601a70e4844b0.pem" ,
266+ "payload" : "%s" % self .pem_cert_content
267+ }
268+ cmdOutput = cmds .setSslCrt (** args ).getCmd ()
269+ self .assertEqual (cmdOutput , self .Resp ["set-ssl-cert" ])
270+
261271 def test_updateSslCrt (self ):
262272 """Test 'set ssl cert <certfile> <payload>' command"""
263273 args = {
You can’t perform that action at this time.
0 commit comments