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

Supports forwarding requests to the backend RS via HTTPS #1215

Merged
merged 4 commits into from
Feb 2, 2025

Conversation

cc14514
Copy link
Collaborator

@cc14514 cc14514 commented Feb 1, 2025

  • Supports forwarding requests to the backend RS via HTTPS protocol using either one-way or two-way authentication.
  • Supports passive health checks for HTTPS and TLS protocols.

func TestKeysDecode(t *testing.T) {
chain := append(BFE_R_CA_CRT.Bytes(), BFE_I_CA_CRT.Bytes()...)

// 解码 PEM 数据
Copy link
Member

Choose a reason for hiding this comment

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

请改为英文注释

"time"
)

// 创建 CN 证书
Copy link
Member

Choose a reason for hiding this comment

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

请改为英文注释

return cert
}

// 创建带 SAN 的证书
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
Member

Choose a reason for hiding this comment

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

请改为英文注释

@cc14514 cc14514 force-pushed the https_backend branch 2 times, most recently from 0cb7eb1 to b9e10eb Compare February 1, 2025 10:41
return def
}

// add by liangc
Copy link
Member

Choose a reason for hiding this comment

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

去掉这样的注释

}

doCheckFn = func(conn net.Conn) checkRtn {
// TLS Check >>>>>>>
Copy link
Member

Choose a reason for hiding this comment

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

“>>>>>>>” 的意思是?

if *checkConf.Schem == "tls" { // https or tls
return checkRtn{true, nil}
}
// TLS Check <<<<<<<
Copy link
Member

Choose a reason for hiding this comment

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

这个注释的意思?

}
// TLS Check <<<<<<<

// HTTPS Check vvvvvvvvvvvvv
Copy link
Member

Choose a reason for hiding this comment

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

“vvvvvvvvvvvvv”的意思?

break
}
}
//data, err = ioutil.ReadAll(conn)
Copy link
Member

Choose a reason for hiding this comment

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

这行代码还要吗?

buf = make([]byte, bufSz)
total = 0
)
//TODO: if timeout , how to handle ?
Copy link
Member

Choose a reason for hiding this comment

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

这个todo解决了吗?

// compareHttpsConf compares two BackendHTTPS configurations and determines whether they are identical.
// Return:
// - bool: Returns true if all fields in src and dst are identical, otherwise false.
func compareHttpsConf(src, dst *cluster_conf.BackendHTTPS) bool {
Copy link
Member

Choose a reason for hiding this comment

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

函数名设计的不合理。
从返回值看,改为httpsConfsAreSame更好。
先不修改了吧

liangchuan added 4 commits February 1, 2025 22:12
Signed-off-by: liangchuan <liangchuan@yf-networks.com>
Signed-off-by: liangchuan <liangchuan@yf-networks.com>
Signed-off-by: liangchuan <liangchuan@yf-networks.com>
Signed-off-by: liangchuan <liangchuan@yf-networks.com>
@mileszhang2016 mileszhang2016 merged commit c2984aa into bfenetworks:develop Feb 2, 2025
3 checks passed
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