ObjFW  Check-in [579dd0a7ee]

Overview
Comment:ofhttp: Add error message for failed TLS handshake
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 579dd0a7eed17cc98346e5229d7b99bb1d6d0ce57574ac191d1d18f20bc91564
User & Date: js on 2023-08-26 10:44:39
Other Links: manifest | tags
Context
2023-08-26
15:30
ofhttp: Prevent empty file name check-in: a45da5cb30 user: js tags: trunk
10:44
ofhttp: Add error message for failed TLS handshake check-in: 579dd0a7ee user: js tags: trunk
2023-08-25
23:32
Fix nullability issues found by clang-analyzer check-in: d93bcda0b2 user: js tags: trunk
Changes

Modified utils/ofhttp/OFHTTP.m from [22d5583cf6] to [32c3b36a14].

48
49
50
51
52
53
54

55
56
57
58
59
60
61
#import "OFInvalidFormatException.h"
#import "OFInvalidServerResponseException.h"
#import "OFOpenItemFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"
#import "OFResolveHostFailedException.h"
#import "OFSetItemAttributesFailedException.h"

#import "OFUnsupportedProtocolException.h"
#import "OFWriteFailedException.h"

#import "ProgressBar.h"

#define GIBIBYTE (1024 * 1024 * 1024)
#define MEBIBYTE (1024 * 1024)







>







48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
#import "OFInvalidFormatException.h"
#import "OFInvalidServerResponseException.h"
#import "OFOpenItemFailedException.h"
#import "OFOutOfRangeException.h"
#import "OFReadFailedException.h"
#import "OFResolveHostFailedException.h"
#import "OFSetItemAttributesFailedException.h"
#import "OFTLSHandshakeFailedException.h"
#import "OFUnsupportedProtocolException.h"
#import "OFWriteFailedException.h"

#import "ProgressBar.h"

#define GIBIBYTE (1024 * 1024 * 1024)
#define MEBIBYTE (1024 * 1024)
856
857
858
859
860
861
862
















863
864
865
866
867
868
869
			[OFStdErr writeLine: OF_LOCALIZED(@"no_tls_support",
			    @"%[prog]: No TLS support in ObjFW!\n"
			    @"  In order to download via HTTPS, you need to "
			    @"either build ObjFW with TLS\n"
			    @"  support or preload a library adding TLS "
			    @"support to ObjFW!",
			    @"prog", [OFApplication programName])];
















		} else if ([exception isKindOfClass:
		    [OFReadOrWriteFailedException class]]) {
			OFString *error = OF_LOCALIZED(
			    @"download_failed_read_or_write_failed_any",
			    @"Read or write failed");

			if (!_quiet)







>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>







857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
			[OFStdErr writeLine: OF_LOCALIZED(@"no_tls_support",
			    @"%[prog]: No TLS support in ObjFW!\n"
			    @"  In order to download via HTTPS, you need to "
			    @"either build ObjFW with TLS\n"
			    @"  support or preload a library adding TLS "
			    @"support to ObjFW!",
			    @"prog", [OFApplication programName])];
		} else if ([exception isKindOfClass:
		    [OFTLSHandshakeFailedException class]]) {
			OFString *error = OFTLSStreamErrorCodeDescription(
			    ((OFTLSHandshakeFailedException *)exception)
			    .errorCode);

			if (!_quiet)
				[OFStdOut writeString: @"\n"];

			[OFStdErr writeLine: OF_LOCALIZED(
			    @"download_failed_tls_handshake_failed",
			    @"%[prog]: Failed to download <%[iri]>!\n"
			    @"  TLS handshake failed: %[error]",
			    @"prog", [OFApplication programName],
			    @"iri", request.IRI.string,
			    @"error", error)];
		} else if ([exception isKindOfClass:
		    [OFReadOrWriteFailedException class]]) {
			OFString *error = OF_LOCALIZED(
			    @"download_failed_read_or_write_failed_any",
			    @"Read or write failed");

			if (!_quiet)

Modified utils/ofhttp/localization/de.json from [d50b9e554d] to [380be9aeb8].

56
57
58
59
60
61
62




63
64
65
66
67
68
69
        "%[prog]: Keine TLS-Unterstützung in ObjFW!\n",
        "  Um via HTTPS runterzuladen müssen Sie entweder ObjFW mit TLS-",
        "Unterstützung\n",
        "  kompilieren oder eine Bibliothek mittels „preload” laden, welche ",
        "TLS-Support\n",
        "  zu ObjFW hinzufügt!"
    ],




    "download_failed_read_or_write_failed_any": "Lesen oder Schreiben",
    "download_failed_read_or_write_failed_read": "Lesen",
    "download_failed_read_or_write_failed_write": "Schreiben",
    "download_failed_read_or_write_failed": [
        "%[prog]: Fehler beim Download von <%[iri]>!\n",
        "  %[error]: %[exception]"
    ],







>
>
>
>







56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
        "%[prog]: Keine TLS-Unterstützung in ObjFW!\n",
        "  Um via HTTPS runterzuladen müssen Sie entweder ObjFW mit TLS-",
        "Unterstützung\n",
        "  kompilieren oder eine Bibliothek mittels „preload” laden, welche ",
        "TLS-Support\n",
        "  zu ObjFW hinzufügt!"
    ],
    "download_failed_tls_handshake_failed": [
        "%[prog]: Fehler beim Download von <%[iri]>!\n",
        "  TLS-Handshake fehlgeschlagen: %[error]"
    ],
    "download_failed_read_or_write_failed_any": "Lesen oder Schreiben",
    "download_failed_read_or_write_failed_read": "Lesen",
    "download_failed_read_or_write_failed_write": "Schreiben",
    "download_failed_read_or_write_failed": [
        "%[prog]: Fehler beim Download von <%[iri]>!\n",
        "  %[error]: %[exception]"
    ],