Skip to content
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

Closed
wants to merge 16 commits into from
Closed

NTLS证书问题 #24

wants to merge 16 commits into from

Conversation

ZBCccc
Copy link
Contributor

@ZBCccc ZBCccc commented Jul 24, 2024

No description provided.

Copy link
Member

@dongbeiouba dongbeiouba left a 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)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥要调用KeepAlive()?

Copy link
Contributor Author

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"),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

为啥要把名字都加1,下同

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

因为加1的文件就是我生成的新的文件。

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

直接替换现有的文件,不用加1,下同

}

// 创建 CA 证书
caKey := generateAndSaveKey("./../test/certs/sm2/ca.key")
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

测试用例中生成的文件不要覆盖仓库中已有的文件,可以搞成临时文件,或者在测试用例结束时清理。

下同。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没有覆盖仓库中已有的文件,新生成的文件都是在原有文件的命名基础上加1

@ZBCccc ZBCccc closed this Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants