From 3fb668474dfb711ae36d8239e3a924c91a79dc0f Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 21 Sep 2017 17:19:43 +0200 Subject: [PATCH 1/2] fix(tls): fix an issue with TLSConfig ignored when using LDAP StartTLS --- api/crypto/tls.go | 40 +++++++++++++++++++--------------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/api/crypto/tls.go b/api/crypto/tls.go index 3d22091d8..976e1a075 100644 --- a/api/crypto/tls.go +++ b/api/crypto/tls.go @@ -12,30 +12,28 @@ import ( func CreateTLSConfiguration(config *portainer.TLSConfiguration) (*tls.Config, error) { TLSConfig := &tls.Config{} - if config.TLS { - if config.TLSCertPath != "" && config.TLSKeyPath != "" { - cert, err := tls.LoadX509KeyPair(config.TLSCertPath, config.TLSKeyPath) - if err != nil { - return nil, err - } - - TLSConfig.Certificates = []tls.Certificate{cert} + if config.TLSCertPath != "" && config.TLSKeyPath != "" { + cert, err := tls.LoadX509KeyPair(config.TLSCertPath, config.TLSKeyPath) + if err != nil { + return nil, err } - if !config.TLSSkipVerify { - caCert, err := ioutil.ReadFile(config.TLSCACertPath) - if err != nil { - return nil, err - } - - caCertPool := x509.NewCertPool() - caCertPool.AppendCertsFromPEM(caCert) - - TLSConfig.RootCAs = caCertPool - } - - TLSConfig.InsecureSkipVerify = config.TLSSkipVerify + TLSConfig.Certificates = []tls.Certificate{cert} } + if !config.TLSSkipVerify { + caCert, err := ioutil.ReadFile(config.TLSCACertPath) + if err != nil { + return nil, err + } + + caCertPool := x509.NewCertPool() + caCertPool.AppendCertsFromPEM(caCert) + + TLSConfig.RootCAs = caCertPool + } + + TLSConfig.InsecureSkipVerify = config.TLSSkipVerify + return TLSConfig, nil } From 4b53c3422f8d957709af45495d7aa50981838633 Mon Sep 17 00:00:00 2001 From: Anthony Lapenna Date: Thu, 21 Sep 2017 17:22:01 +0200 Subject: [PATCH 2/2] chore(version): bump version number --- api/portainer.go | 2 +- api/swagger.yaml | 4 ++-- bower.json | 2 +- package.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/portainer.go b/api/portainer.go index b641ef5cd..b2a2156a3 100644 --- a/api/portainer.go +++ b/api/portainer.go @@ -345,7 +345,7 @@ type ( const ( // APIVersion is the version number of the Portainer API. - APIVersion = "1.14.1" + APIVersion = "1.14.2" // DBVersion is the version number of the Portainer database. DBVersion = 4 // DefaultTemplatesURL represents the default URL for the templates definitions. diff --git a/api/swagger.yaml b/api/swagger.yaml index 255a62949..8679e7dd9 100644 --- a/api/swagger.yaml +++ b/api/swagger.yaml @@ -56,7 +56,7 @@ info: **NOTE**: You can find more information on how to query the Docker API in the [Docker official documentation](https://docs.docker.com/engine/api/v1.30/) as well as in [this Portainer example](https://gist.github.com/deviantony/77026d402366b4b43fa5918d41bc42f8). - version: "1.14.1" + version: "1.14.2" title: "Portainer API" contact: email: "info@portainer.io" @@ -1869,7 +1869,7 @@ definitions: description: "Is analytics enabled" Version: type: "string" - example: "1.14.1" + example: "1.14.2" description: "Portainer API version" PublicSettingsInspectResponse: type: "object" diff --git a/bower.json b/bower.json index 764a9fb4d..9903ba49f 100644 --- a/bower.json +++ b/bower.json @@ -1,6 +1,6 @@ { "name": "portainer", - "version": "1.14.1", + "version": "1.14.2", "homepage": "https://github.com/portainer/portainer", "authors": [ "Anthony Lapenna " diff --git a/package.json b/package.json index c1ea2d995..7f369a022 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "author": "Portainer.io", "name": "portainer", "homepage": "http://portainer.io", - "version": "1.14.1", + "version": "1.14.2", "repository": { "type": "git", "url": "git@github.com:portainer/portainer.git"