Fix gob register issue when using tls certs on plugins (#3060)

This commit is contained in:
Calvin Leung Huang 2017-07-26 13:44:07 -04:00 committed by GitHub
parent ba9bd5a2c7
commit 40c1c93937

View file

@ -1,6 +1,9 @@
package plugin
import (
"crypto/ecdsa"
"crypto/rsa"
"encoding/gob"
"fmt"
"sync"
@ -10,6 +13,13 @@ import (
"github.com/hashicorp/vault/logical"
)
// Register these types since we have to serialize and de-serialize tls.ConnectionState
// over the wire as part of logical.Request.Connection.
func init() {
gob.Register(rsa.PublicKey{})
gob.Register(ecdsa.PublicKey{})
}
// BackendPluginClient is a wrapper around backendPluginClient
// that also contains its plugin.Client instance. It's primarily
// used to cleanly kill the client on Cleanup()