-
Notifications
You must be signed in to change notification settings - Fork 9
config submitter part 2 #298
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
Conversation
08e65db to
4e5dc6c
Compare
4e5dc6c to
2755521
Compare
2755521 to
c0cb710
Compare
c0cb710 to
f2049e7
Compare
f2049e7 to
b80b629
Compare
config/config.go
Outdated
| panic(fmt.Sprintf("Failed marshaling consenter public key: %v", err)) | ||
| routerInfo := nodeconfig.RouterInfo{ | ||
| PartyID: partyID, | ||
| Endpoint: routerConfig.Host + ":" + strconv.Itoa(int(routerConfig.Port)), |
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.
This trick will not work well with IPv6.
To construct a string from an IP address and port in Go, the net.JoinHostPort function is the recommended approach. This function correctly handles various IP address formats, including IPv6, and ensures the proper formatting of the "host:port" string.
node/consensus/consensus.go
Outdated
|
|
||
| // compare the two certificates | ||
| if !bytes.Equal(pemBlock.Bytes, cert.Raw) { | ||
| return fmt.Errorf("error: access denied. The client certificate does not match the router's certificate") |
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.
Here, because it is a config or security problem, log the details of the offending incoming cert, in human readable format as well as raw. This may help correct the issue.
node/router/stream.go
Outdated
| // send error to the client | ||
| s.responseToClientWithError(tr, fmt.Errorf("request verification error: %s", err)) | ||
| } else { | ||
| // TODO - if request is config, forward it to the consenter using configSubmitter |
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.
This is unrelated to the current PR, but an early return approach in the if is more readable and preferrable in Go. That is,
if err := s.verifier.Verify(tr.request); err != nil {
s.logger.Debugf("request is invalid: %s", err)
// send error to the client
s.responseToClientWithError(tr, fmt.Errorf("request verification error: %s", err))
continue
}
... code for no err==nil
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.
next PR will address this code
b80b629 to
6c76970
Compare
f202ac5 to
1b1ec73
Compare
add router info to consenter config router's certificate pinning in SubmitConfig add configSubmitter to router, without forwarding config requests Signed-off-by: Dor.Katzelnick <Dor.Katzelnick@ibm.com>
1b1ec73 to
5705b36
Compare
issue: #192