首页
📷在线壁纸
🎬娱乐天地
🔖友情链接
更多
📝留言板
Search
1
【javascript】JS-向当前url追加参数
2,341 阅读
2
【PHP】生成随机昵称
2,195 阅读
3
【PHP】判断一个字符串是否属于序列化后的数据
2,022 阅读
4
【css】html+css给文章页,做阅读全文
1,973 阅读
5
【PHP】 设计模式(23种)
1,905 阅读
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇mysql
🍈Winform
🍓golang
🍉设计模式
🥝PHP
🍎python
🍊nginx
🍋网络安全
🍍javascript
🫑database
🍭文艺范
🍏mac
Search
标签搜索
php
typecho
代码注释
mysql
redis
nginx
thinkphp
golang
docker
html
curl
linux
go
mamp
laravel
跨域
http
rsa
sql
酒
依然范儿特西
累计撰写
128
篇文章
累计收到
26
条评论
首页
栏目
📂默认分类
💓typecho
🏳️🌈代码改变世界
🍇mysql
🍈Winform
🍓golang
🍉设计模式
🥝PHP
🍎python
🍊nginx
🍋网络安全
🍍javascript
🫑database
🍭文艺范
🍏mac
页面
📷在线壁纸
🎬娱乐天地
🔖友情链接
📝留言板
搜索到
1
篇与
https
的结果
2021-09-01
Golang 获取https证书信息、过期信息
package main import ( "crypto/tls" "fmt" "net/http" ) func main() { tr := &http.Transport{ TLSClientConfig: &tls.Config{InsecureSkipVerify: true}, } client := &http.Client{Transport: tr} seedUrl := "https://richerdyoung.com" resp, err := client.Get(seedUrl) defer resp.Body.Close() if err != nil { fmt.Errorf(seedUrl," 请求失败") panic(err) } //fmt.Println(resp.TLS.PeerCertificates[0]) certInfo:=resp.TLS.PeerCertificates[0] fmt.Println("过期时间:",certInfo.NotAfter) fmt.Println("组织信息:",certInfo.Subject) } 运行结果过期时间: 2021-09-02 07:27:20 +0000 UTC 组织信息: CN=www.richerdyoung.com
2021年09月01日
317 阅读
0 评论
1 点赞