mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-06 22:30:56 +03:00
allow to configure the minimum version of TLS to be enabled
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package common
|
||||
|
||||
import (
|
||||
"crypto/tls"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"net"
|
||||
@@ -869,6 +870,17 @@ func TestUserPerms(t *testing.T) {
|
||||
assert.True(t, u.HasPermsRenameAll("/"))
|
||||
}
|
||||
|
||||
func TestGetTLSVersion(t *testing.T) {
|
||||
tlsVer := util.GetTLSVersion(0)
|
||||
assert.Equal(t, uint16(tls.VersionTLS12), tlsVer)
|
||||
tlsVer = util.GetTLSVersion(12)
|
||||
assert.Equal(t, uint16(tls.VersionTLS12), tlsVer)
|
||||
tlsVer = util.GetTLSVersion(2)
|
||||
assert.Equal(t, uint16(tls.VersionTLS12), tlsVer)
|
||||
tlsVer = util.GetTLSVersion(13)
|
||||
assert.Equal(t, uint16(tls.VersionTLS13), tlsVer)
|
||||
}
|
||||
|
||||
func BenchmarkBcryptHashing(b *testing.B) {
|
||||
bcryptPassword := "bcryptpassword"
|
||||
for i := 0; i < b.N; i++ {
|
||||
|
||||
Reference in New Issue
Block a user