握手与密钥协商过程
基于RSA握手和密钥交换的客户端验证服务器为示例详解TLS/SSL握手过程。
客户端发起请求,以明文传输请求信息,包含版本信息,加密套件候选列表,压缩算法候选列表,随机数,扩展字段等信息,相关信息如下:
支持的最高TSL协议版本version,从低到高依次 SSLv2 SSLv3 TLSv1 TLSv1.1 TLSv1.2,当前基本不再使用低于 TLSv1 的版本;
``` | |
// 函数 | |
// 判断在 b(s、r)中能否找到 pattern 所匹配的字符串 | |
func Match(pattern string, b []byte) (matched bool, err error) | |
func MatchString(pattern string, s string) (matched bool, err error) | |
func MatchReader(pattern string, r io.RuneReader) (matched bool, err error) | |
// 将 s 中的正则表达式元字符转义成普通字符。 | |
func QuoteMeta(s string) string |
package main | |
import ( | |
"errors" | |
"fmt" | |
) | |
// Rule struct | |
type Rule struct { | |
match func(x, y int) bool |
package main | |
import "fmt" | |
func main() { | |
test := []int{0, 1, 2} | |
fmt.Printf("最初的内存地址是 %p 值为:%v \n", test, test) | |
change(test) | |
fmt.Printf("出函数的内存地址是 %p 值为:%v \n", test, test) | |
} |
package main | |
import ( | |
"fmt" | |
"os" | |
"os/signal" | |
"syscall" | |
) | |
func main() { |
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
data := []int{1, 2, 3, 4} | |
// data |> time |> plus | |
ret := plus(time(data)) |
package main | |
import ( | |
"log" | |
"time" | |
) | |
func main() { | |
log.Println("start") | |
num, err := func() (int, error) { |
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse | |
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse |
#aliyun | |
deb-src http://archive.ubuntu.com/ubuntu xenial main restricted | |
deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted | |
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted multiverse universe | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted | |
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted multiverse universe | |
deb http://mirrors.aliyun.com/ubuntu/ xenial universe | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates universe | |
deb http://mirrors.aliyun.com/ubuntu/ xenial multiverse | |
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates multiverse |
bmb.logo |