Comments (12)
This is how the certificate file looks like in notepad++ after enabling "show all characters" - so I would say nothing unusual:
(content is censored as the black block)from crc.
Would it be possible to log in to the VM and share the content of /tmp/user-ca-bundle.json
?
from crc.
Is it possible to submit the file in a private Red Hat Support Ticket?
If not I'll generate a new cert that I will be able to share publicly (even if it is just about the public part).
from crc.
This code
crc/pkg/crc/cluster/cluster.go
Lines 388 to 391 in 97705a0
\r\n
with \n
, but according to the error message there are some \r
left after doing this.
Could you check your cert file for occurrences of \r
, in particular occurrences which are not followed by \n
? https://stackoverflow.com/questions/1446370/text-editor-which-shows-r-n has some suggestions to see these special chars on Windows.
from crc.
replaces \r\n with \n, b
@cfergeau according to the comment it
Replace the carriage return ("\n
" or "\r\n
") with the string appended with \n
To what I understand, this matches 'once' all the options:
- optionally match '\r'
- Exactly once match '\n'
So what if the file contained multiple matches of a newline?
from crc.
The code uses re.ReplaceAllString
which should replace all occurrences.
from crc.
I also copied the user-ca-bundle.json via scp to the Windows host and opened in notepad++.
The highlighted part (yellow) looks strange, no?
CR"LF
from crc.
This is how the certificate file looks like in notepad++ after enabling "show all characters" - so I would say nothing unusual:
I managed to work around the issue by removing line 23 (the last empty line).
This should give you a good hint as to where the root cause of this issue is so it can be fixed for other users.
from crc.
I managed to work around the issue by removing line 23 (the last empty line).
What does the file looks like after removing this 'empty' line? and/or on line 22 disappears?
The on line 4 of user-ca-bundle.json is what is causing the problem. Are there more occurences in line 4 or is this the only one?
I tried to reproduce with data similar to yours ( cacert := "----BEGIN CERTIFICATE----\r\nXXXXV\r\nXXXX3\r\nXXXXF\r\nXXXXM=\r\n----END CERTIFICATE----\r\n"
) but this behaves as expected - no extra /r
.
from crc.
This is how the certificate file looks like with the "workaround" applied:
- no empty line 23
- no CRLF in line 22
from crc.
The on line 4 of user-ca-bundle.json is what is causing the problem. Are there more occurences in line 4 or is this the only one?
Did you mean
The "one" line 4 of ...
there?
from crc.
I found out the issue and able to reproduce it, looks like our trimTrailingEOL
need to be updated for \r\n
instead just for \n
. I am going to update this function and also try to add test case around it even replacing \r\n
=> \n
should be part of httpproxy
package.
package main
import (
"fmt"
"strings"
)
func parseProxyCAData() (string, error) {
rawData := "-----BEGIN CERTIFICATE-----\r\nMIID6zCCAtOgAwIB\r\nKMGinNDOEwKTFXf\r\n-----END CERTIFICATE-----\r\n\r\n"
return trimTrailingEOL(rawData), nil
}
func trimTrailingEOL(s string) string {
fmt.Printf("s: %#v", s)
s1 := strings.TrimRight(s, "\n")
fmt.Println()
fmt.Printf("s1: %#v", s1)
return s1
}
func main() {
_, err := parseProxyCAData()
if err != nil {
fmt.Printf("error: %v", err)
}
}
Output
$ go run main.go
s: "-----BEGIN CERTIFICATE-----\r\nMIID6zCCAtOgAwIB\r\nKMGinNDOEwKTFXf\r\n-----END CERTIFICATE-----\r\n\r\n"
s1: "-----BEGIN CERTIFICATE-----\r\nMIID6zCCAtOgAwIB\r\nKMGinNDOEwKTFXf\r\n-----END CERTIFICATE-----\r\n\r" <= here is the extra \r
from crc.
Related Issues (20)
- [BUG] crc start fails on ` Waiting until the user's pull secret is written to the instance disk...` step HOT 19
- Should LVM storage operator be enabled by default? HOT 2
- Pods in openshift-marketplace namespace crashing - cache requires rebuild: cache reports digest HOT 2
- [BUG] error: connect: connection refused - verify you have provided the correct host and port and that the server is currently running. HOT 5
- Can not find GitLab Runner under community operator inside the CRC HOT 4
- failed to expose port :443 -> 192.168.127.2:443: listen tcp :443: bind: address already in use HOT 6
- [BUG] make vendorcheck should catch go sum/mod file changes as part of vendor run
- [BUG] CI gh action for windows tester picking images out of sync
- Push image failed "connection refused" to openshift local from podman HOT 7
- [BUG] Fails to resolve nameserver when run own DNS server through docker. HOT 21
- [Feature] Add one-shot systemd service to update /etc/resolv.conf in the instance
- [BUG] - Failed to update pull secret on the disk: Temporary error: pull secret not updated to disk (x31) HOT 8
- [QE] Integration test scenario change memory cpus and disk does not honor custom bundle
- CRC openshift local marketplace pods Failed to pull image failed to verify certificate: x509 HOT 2
- [RFE] Create arm64 linux binary along with amd64 HOT 4
- Failed to update pull secret on the disk: Temporary error: pull secret not updated to disk HOT 3
- [QE] Windows tester integration tests failing randomly
- Implement 9P client support for libhvee
- [QE] certificate has expired or is not yet valid HOT 1
- [QE] Add test scenario for file sharing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crc.