This repository was archived by the owner on Mar 20, 2025. It is now read-only.
Dev testtls - #16
Draft
guijunchen wants to merge 3 commits into
Draft
Conversation
added 2 commits
January 15, 2021 01:10
Signed-off-by: 陈桂军 <chengj16@bngrp.com>
Signed-off-by: 陈桂军 <chengj16@bngrp.com>
davidkhala
reviewed
Jan 15, 2021
|
|
||
| func main() { | ||
| const address = "127.0.0.1:6443" | ||
| const caFile = "../asserts/sm2-double-cert/CA.crt" |
Member
There was a problem hiding this comment.
这里和上面用的文件目录名都叫 asserts,是想表达assets的意思么?还是就是断言的意思?
SamYuan1990
suggested changes
Jan 15, 2021
SamYuan1990
left a comment
Member
There was a problem hiding this comment.
可以参考下 https://github.com/guoger/tape/blob/master/e2e/e2e_test.go 结合使用 "github.com/onsi/gomega/gexec"
库和fmt标准输出,优化一下我们的测试代码。(如果可能)
| @@ -0,0 +1,5 @@ | |||
| -----BEGIN PRIVATE KEY----- | |||
| func clientRun(address, caFile, signCertFile, signKeyFile, encCertFile, encKeyFile string) { | ||
| signCert, err := tls.LoadX509KeyPair(signCertFile, signKeyFile) | ||
| if err != nil { | ||
| log.Fatalf("Failed to load LoadX509KeyPair: %v", err) |
| if err != nil { | ||
| log.Fatalf("Failed to read num: %v, err:%v", n, err) | ||
| } | ||
| fmt.Printf("Receive server message: %s\n", string(buf[:n])) |
| log.Println(err) | ||
| continue | ||
| } | ||
| go handleConn(conn) |
Member
There was a problem hiding this comment.
考虑下一些golang的已经有的库,避免重复造轮子?以及作为示例程序会更好?
| log.Println(err) | ||
| return | ||
| } | ||
| fmt.Printf("Receive client message:%s\n", msg) |
| ) | ||
|
|
||
| func Test(t *testing.T) { | ||
| end = make(chan bool, 64) |
Member
There was a problem hiding this comment.
试试看 "github.com/onsi/gomega/gexec"
…S handshake Signed-off-by: 陈桂军 <chengj16@bngrp.com>
davidkhala
marked this pull request as draft
May 7, 2021 13:45
SHenry07
pushed a commit
to SHenry07/ccs-gm
that referenced
this pull request
Oct 14, 2021
modify sm4.ReadKeyFromPem
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
添加支持测试tls单、双证书代码