forked from denisenkom/go-mssqldb
-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3b46584
commit 5f09ec8
Showing
3 changed files
with
44 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
//go:build go1.12 | ||
// +build go1.12 | ||
|
||
package msdsn | ||
|
||
import "crypto/tls" | ||
|
||
func TLSVersionFromString(minTLSVersion string) uint16 { | ||
switch minTLSVersion { | ||
case "1.0": | ||
return tls.VersionTLS10 | ||
case "1.1": | ||
return tls.VersionTLS11 | ||
case "1.2": | ||
return tls.VersionTLS12 | ||
case "1.3": | ||
return tls.VersionTLS13 | ||
default: | ||
// use the tls package default | ||
} | ||
return 0 | ||
} |
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,20 @@ | ||
//go:build !go1.12 | ||
// +build !go1.12 | ||
|
||
package msdsn | ||
|
||
import "crypto/tls" | ||
|
||
func TLSVersionFromString(minTLSVersion string) uint16 { | ||
switch minTLSVersion { | ||
case "1.0": | ||
return tls.VersionTLS10 | ||
case "1.1": | ||
return tls.VersionTLS11 | ||
case "1.2": | ||
return tls.VersionTLS12 | ||
default: | ||
// use the tls package default | ||
} | ||
return 0 | ||
} |