-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NTLS证书问题 #24
NTLS证书问题 #24
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试生成的证书私钥不要覆盖代码仓库的文件,可以用临时的名字,最后清理。然后用生成的私钥和证书文件再测试TLCP(ntls)。
需要增加Example,签发签名和加密双证书。
} | ||
|
||
result := C.GoBytes(unsafe.Pointer(ptr), C.int(length)) | ||
runtime.KeepAlive(key) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥要调用KeepAlive()?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
runtime.KeepAlive(key)确保在转换过程中,key对象不会被垃圾回收。
ntls_test.go
Outdated
@@ -32,15 +32,15 @@ func TestNTLS(t *testing.T) { | |||
{ | |||
cipher: ECCSM2Cipher, | |||
runServer: internalServer, | |||
caFile: filepath.Join(testCertDir, "chain-ca.crt"), | |||
caFile: filepath.Join(testCertDir, "chain-ca1.crt"), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
为啥要把名字都加1,下同
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
因为加1的文件就是我生成的新的文件。
test/certs/sm2/chain-ca1.crt
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
直接替换现有的文件,不用加1,下同
crypto/cert_test.go
Outdated
} | ||
|
||
// 创建 CA 证书 | ||
caKey := generateAndSaveKey("./../test/certs/sm2/ca.key") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
测试用例中生成的文件不要覆盖仓库中已有的文件,可以搞成临时文件,或者在测试用例结束时清理。
下同。
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
没有覆盖仓库中已有的文件,新生成的文件都是在原有文件的命名基础上加1
# Conflicts: # crypto/key.go
# Conflicts: # crypto/cert_test.go
# Conflicts: # crypto/cert_test.go
No description provided.