@@ -469,13 +469,27 @@ def start_cluster(
469469 logging .info (f"Certificate { remote_name } first 100 bytes: { cert_content [:100 ]} " )
470470 logging .info (f"Certificate { remote_name } last 100 bytes: { cert_content [- 100 :]} " )
471471
472+ # Check for line ending types
473+ lf_count = cert_content .count (b'\n ' )
474+ crlf_count = cert_content .count (b'\r \n ' )
475+ cr_count = cert_content .count (b'\r ' ) - crlf_count
476+
477+ logging .info (f"Certificate { remote_name } line endings: LF={ lf_count } , CRLF={ crlf_count } , CR={ cr_count } " )
478+
472479 # Print as hex for exact comparison with Rust output
473480 hex_first = ' ' .join (f'{ b :02x} ' for b in cert_content [:50 ])
474481 logging .info (f"Certificate { remote_name } first 50 bytes hex: { hex_first } " )
475482
476- # Verify it's valid PEM
483+ # Check for PEM structure
477484 if b'-----BEGIN' in cert_content and b'-----END' in cert_content :
478485 logging .info (f"Certificate { remote_name } appears to be valid PEM format" )
486+
487+ # Check if base64 content has proper line breaks
488+ lines = cert_content .decode ('utf-8' , errors = 'ignore' ).split ('\n ' )
489+ base64_lines = [line for line in lines if line and not line .startswith ('-----' )]
490+ if base64_lines :
491+ avg_line_length = sum (len (line ) for line in base64_lines ) / len (base64_lines )
492+ logging .info (f"Certificate { remote_name } average base64 line length: { avg_line_length :.1f} " )
479493 else :
480494 logging .warning (f"Certificate { remote_name } does NOT appear to be valid PEM format" )
481495
@@ -995,11 +1009,11 @@ def test_certificates_on_server(self, endpoints: List[str]) -> None:
9951009 logging .info (f" { line } " )
9961010
9971011 # Print raw certificate content for comparison
998- cert_content_cmd = f"cd { self .remote_repo_path } /utils && wc -c tls_crts/ca.crt && head -c 100 tls_crts/ca.crt && echo && tail -c 100 tls_crts/ca.crt"
1012+ cert_content_cmd = f"cd { self .remote_repo_path } /utils && wc -c tls_crts/ca.crt && echo '=== FIRST 200 CHARS ===' && head -c 200 tls_crts/ca.crt && echo && echo '=== LAST 200 CHARS ===' && tail -c 200 tls_crts/ca.crt && echo && echo '=== LINE ENDINGS CHECK ===' && od -c tls_crts/ca.crt | head -5 "
9991013 returncode , stdout , stderr = self ._execute_remote_command (cert_content_cmd , timeout = 5 )
10001014
10011015 if returncode == 0 :
1002- logging .info ("Server certificate raw content:" )
1016+ logging .info ("Server certificate raw content and line endings :" )
10031017 for line in stdout .split ('\n ' ):
10041018 if line .strip ():
10051019 logging .info (f" { line } " )
0 commit comments