trafficcontrol-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From raw...@apache.org
Subject [trafficcontrol] 01/02: Fix TO Go DS SSL key to also create latest version
Date Tue, 18 Sep 2018 16:40:43 GMT
This is an automated email from the ASF dual-hosted git repository.

rawlin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficcontrol.git

commit 6f70a8705c6ed23e83f7a9fd8e5ae6310d3057cf
Author: Robert Butts <rob@apache.org>
AuthorDate: Mon Sep 17 15:18:30 2018 -0600

    Fix TO Go DS SSL key to also create latest version
    
    Fixes #2828
---
 traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go b/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go
index 0efba68..0ab9916 100644
--- a/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go
+++ b/traffic_ops/traffic_ops_golang/deliveryservice/sslkeys.go
@@ -51,6 +51,8 @@ func GenerateSSLKeys(w http.ResponseWriter, r *http.Request) {
 	api.WriteResp(w, r, "Successfully created ssl keys for "+*req.DeliveryService)
 }
 
+const DSSSLKeyVersionLatest = `latest`
+
 // generatePutRiakKeys generates a certificate, csr, and key from the given request, and
insert it into the Riak key database.
 // The req MUST be validated, ensuring required fields exist.
 func generatePutRiakKeys(req tc.DeliveryServiceSSLKeysReq, tx *sql.Tx, cfg *config.Config)
error {
@@ -78,5 +80,10 @@ func generatePutRiakKeys(req tc.DeliveryServiceSSLKeysReq, tx *sql.Tx,
cfg *conf
 	if err := riaksvc.PutDeliveryServiceSSLKeysObjTx(dsSSLKeys, tx, cfg.RiakAuthOptions); err
!= nil {
 		return errors.New("putting riak keys: " + err.Error())
 	}
+
+	dsSSLKeys.Version = DSSSLKeyVersionLatest
+	if err := riaksvc.PutDeliveryServiceSSLKeysObjTx(dsSSLKeys, tx, cfg.RiakAuthOptions); err
!= nil {
+		return errors.New("putting latest riak keys: " + err.Error())
+	}
 	return nil
 }


Mime
View raw message