forked from rexray/rexray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for default TLS with auto-gen certs
This patch enables TLS as the default communication method for accessing a remote libStorage API endpoint. Additional features include: * Auto-creation of x509 public and private key files upon installation * Interactive CLI to allow users to trust an unknown, remote host. This feature behaves just like SSH's known hosts functionality.
- Loading branch information
1 parent
8e04870
commit aaa0d27
Showing
11 changed files
with
478 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// +build rexray_build_type_client rexray_build_type_agent | ||
|
||
package cli | ||
|
||
import ( | ||
gofig "github.com/akutz/gofig/types" | ||
apitypes "github.com/codedellemc/libstorage/api/types" | ||
) | ||
|
||
func installSelfCert(ctx apitypes.Context, config gofig.Config) {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
// +build !rexray_build_type_client | ||
// +build !rexray_build_type_agent | ||
|
||
package cli | ||
|
||
import ( | ||
"fmt" | ||
|
||
log "github.com/Sirupsen/logrus" | ||
gofig "github.com/akutz/gofig/types" | ||
apitypes "github.com/codedellemc/libstorage/api/types" | ||
"github.com/codedellemc/rexray/util" | ||
) | ||
|
||
func installSelfCert(ctx apitypes.Context, config gofig.Config) { | ||
certPath := config.GetString(apitypes.ConfigTLSCertFile) | ||
keyPath := config.GetString(apitypes.ConfigTLSKeyFile) | ||
host := "127.0.0.1" | ||
|
||
fmt.Println("Generating server self-signed certificate...") | ||
if err := util.CreateSelfCert(ctx, certPath, keyPath, host); err != nil { | ||
log.Fatalf("cert generation failed: %v\n", err) | ||
} | ||
|
||
fmt.Printf("Created cert file %s, key %s\n\n", certPath, keyPath) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.