Skip to content

Commit e0d4c4c

Browse files
committed
Fix SSLv3 support and warning #70
1 parent e43d0fd commit e0d4c4c

File tree

8 files changed

+47
-28
lines changed

8 files changed

+47
-28
lines changed

archive/release-template.md

+10-6
Original file line numberDiff line numberDiff line change
@@ -63,18 +63,22 @@ This directory contains the curl and openssl headers (in the `include` folder),
6363
|__ tvos-arm64/
6464
|__ tvos-arm64_x86_64-simulator/
6565

66+
## Usage
67+
6668
## Usage
6769

6870
1. Copy headers to your project.
69-
2. Import appropriate libraries: "libssl.a", "libcrypto.a", "libcurl.a", "libnghttp2.a" *or*
70-
**XCFrameworks Alternative**: Import appropriate *xcframework* folders into your project in Xcode.
71+
2. Import **XCFrameworks**: Import appropriate *xcframework* folders into your project in Xcode.
72+
Alternative: Import appropriate libraries: "libssl.a", "libcrypto.a", "libcurl.a", "libnghttp2.a"
7173
3. Reference Headers.
72-
4. Specifying the flag "-lz" in "Other Linker Flags" (OTHER_LDFLAGS) setting in the "Linking" section in the Build settings of the target.
74+
4. If required, specify the flag "-lz" in "Other Linker Flags" (OTHER_LDFLAGS) setting in the "Linking" section in the Build settings of the target.
7375
5. Initialize curl in your code:
7476

77+
```cpp
7578
#include <curl/curl.h>
7679

77-
- (void)foo {
80+
(void)foo {
7881
CURL* cURL = curl_easy_init();
79-
...
80-
}
82+
// ...
83+
}
84+
```

build.sh

+9-2
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ set -e
1515

1616
#OPENSSL="1.1.1u" # https://www.openssl.org/source/
1717
OPENSSL="3.0.13" # https://www.openssl.org/source/
18-
LIBCURL="8.6.0" # https://curl.haxx.se/download.html
18+
LIBCURL="8.7.1" # https://curl.haxx.se/download.html
1919
NGHTTP2="1.60.0" # https://nghttp2.org/
2020

2121
################################################
@@ -124,7 +124,14 @@ while getopts "o:c:n:u:s:t:i:a:debm3xh\?" o; do
124124
CATALYST_IOS="${OPTARG}"
125125
;;
126126
3)
127-
sslv3="-3"
127+
echo "WARNING: SSLv3 is requested. SSLv3 is not secure and has been deprecated."
128+
echo "If you proceed, builds may fail as SSLv3 is not supported by recent curl version."
129+
read -p "Do you want to continue (y/N)? " choice
130+
case "$choice" in
131+
y|Y ) echo "Continuing with SSLv3 build"; echo "";;
132+
* ) echo "Exiting"; exit 1;;
133+
esac
134+
sslv3="-3"
128135
;;
129136
s)
130137
IOS_MIN_SDK_VERSION="${OPTARG}"

curl/libcurl-build.sh

+2-1
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ if [ ! -e ${CURL_VERSION}.tar.gz ]; then
538538
echo -e "${dim}Downloading ${CURL_VERSION}.tar.gz"
539539
curl -LOs https://curl.haxx.se/download/${CURL_VERSION}.tar.gz
540540
else
541-
echo -e"${dim}Using ${CURL_VERSION}.tar.gz"
541+
echo -e "${dim}Using ${CURL_VERSION}.tar.gz"
542542
fi
543543

544544
echo -e "${dim}Unpacking curl"
@@ -553,6 +553,7 @@ if [ ${FORCE_SSLV3} == 'yes' ]; then
553553
sed -i '' '/version == CURL_SSLVERSION_SSLv3/d' "${CURL_VERSION}/lib/setopt.c"
554554
patch --ignore-whitespace -N "${CURL_VERSION}/lib/vtls/openssl.c" sslv3.patch || true
555555
# for command line
556+
sed -i '' -e 's/warnf(global, \"Ignores instruction to use SSLv3\");/config->ssl_version = CURL_SSLVERSION_SSLv3;/g' "${CURL_VERSION}/src/tool_getparam.c"
556557
sed -i '' -e 's/warnf(global, \"Ignores instruction to use SSLv3\\n\");/config->ssl_version = CURL_SSLVERSION_SSLv3;/g' "${CURL_VERSION}/src/tool_getparam.c"
557558
fi
558559
fi

curl/sslv3.patch

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
- failf(data, "No SSLv3 support");
88
- return CURLE_NOT_BUILT_IN;
99
+ req_method = SSLv3_client_method();
10-
+ use_sni(FALSE);
10+
+ /* use_sni(FALSE); */
1111
+ break;
1212
default:
1313
failf(data, "Unrecognized parameter passed via CURLOPT_SSLVERSION");

example/iOS Test App/iOS Test App/Base.lproj/Main.storyboard

+18-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="16097.3" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="32700.99.1234" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" colorMatched="YES" initialViewController="BYZ-38-t0r">
33
<device id="retina6_1" orientation="portrait" appearance="light"/>
44
<dependencies>
55
<deployment identifier="iOS"/>
6-
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="16087"/>
6+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="22684"/>
7+
<capability name="System colors in document resources" minToolsVersion="11.0"/>
78
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
89
</dependencies>
910
<scenes>
@@ -32,11 +33,11 @@
3233
<nil key="textColor"/>
3334
<nil key="highlightedColor"/>
3435
</label>
35-
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4wA-r7-IzH">
36+
<button opaque="NO" contentMode="scaleToFill" fixedFrame="YES" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="system" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="4wA-r7-IzH">
3637
<rect key="frame" x="348" y="106" width="30" height="30"/>
3738
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" flexibleMaxY="YES"/>
3839
<state key="normal" title="GET">
39-
<color key="titleColor" cocoaTouchSystemColor="darkTextColor"/>
40+
<color key="titleColor" systemColor="darkTextColor"/>
4041
</state>
4142
<connections>
4243
<action selector="Get:" destination="BYZ-38-t0r" eventType="touchUpInside" id="2Y9-vf-DgB"/>
@@ -45,12 +46,12 @@
4546
<textView clipsSubviews="YES" contentMode="scaleToFill" fixedFrame="YES" alwaysBounceVertical="YES" showsHorizontalScrollIndicator="NO" textAlignment="natural" translatesAutoresizingMaskIntoConstraints="NO" id="cde-8a-gKJ">
4647
<rect key="frame" x="48" y="148" width="318" height="714"/>
4748
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
48-
<color key="backgroundColor" systemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/>
49+
<color key="backgroundColor" systemColor="systemBackgroundColor"/>
4950
<fontDescription key="fontDescription" type="system" pointSize="14"/>
5051
<textInputTraits key="textInputTraits" autocorrectionType="no" spellCheckingType="no"/>
5152
</textView>
5253
</subviews>
53-
<color key="backgroundColor" systemColor="systemGrayColor" red="0.5568627451" green="0.5568627451" blue="0.57647058819999997" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
54+
<color key="backgroundColor" systemColor="systemGrayColor"/>
5455
</view>
5556
<connections>
5657
<outlet property="_appTitle" destination="Wnb-QK-GJr" id="XHy-jB-4Vb"/>
@@ -63,4 +64,15 @@
6364
<point key="canvasLocation" x="117.39130434782609" y="135.9375"/>
6465
</scene>
6566
</scenes>
67+
<resources>
68+
<systemColor name="darkTextColor">
69+
<color white="0.0" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
70+
</systemColor>
71+
<systemColor name="systemBackgroundColor">
72+
<color white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
73+
</systemColor>
74+
<systemColor name="systemGrayColor">
75+
<color red="0.55686274509803924" green="0.55686274509803924" blue="0.57647058823529407" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
76+
</systemColor>
77+
</resources>
6678
</document>

example/iOS Test App/include/curl/curl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -2938,7 +2938,8 @@ typedef enum {
29382938
CURLINFO_XFER_ID = CURLINFO_OFF_T + 63,
29392939
CURLINFO_CONN_ID = CURLINFO_OFF_T + 64,
29402940
CURLINFO_QUEUE_TIME_T = CURLINFO_OFF_T + 65,
2941-
CURLINFO_LASTONE = 65
2941+
CURLINFO_USED_PROXY = CURLINFO_LONG + 66,
2942+
CURLINFO_LASTONE = 66
29422943
} CURLINFO;
29432944

29442945
/* CURLINFO_RESPONSE_CODE is the new name for the option previously known as

example/iOS Test App/include/curl/curlver.h

+5-5
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,13 @@
3232

3333
/* This is the version number of the libcurl package from which this header
3434
file origins: */
35-
#define LIBCURL_VERSION "8.6.0"
35+
#define LIBCURL_VERSION "8.7.1"
3636

3737
/* The numeric version number is also available "in parts" by using these
3838
defines: */
3939
#define LIBCURL_VERSION_MAJOR 8
40-
#define LIBCURL_VERSION_MINOR 6
41-
#define LIBCURL_VERSION_PATCH 0
40+
#define LIBCURL_VERSION_MINOR 7
41+
#define LIBCURL_VERSION_PATCH 1
4242

4343
/* This is the numeric version of the libcurl version number, meant for easier
4444
parsing and comparisons by programs. The LIBCURL_VERSION_NUM define will
@@ -59,7 +59,7 @@
5959
CURL_VERSION_BITS() macro since curl's own configure script greps for it
6060
and needs it to contain the full number.
6161
*/
62-
#define LIBCURL_VERSION_NUM 0x080600
62+
#define LIBCURL_VERSION_NUM 0x080701
6363

6464
/*
6565
* This is the date and time when the full source package was created. The
@@ -70,7 +70,7 @@
7070
*
7171
* "2007-11-23"
7272
*/
73-
#define LIBCURL_TIMESTAMP "2024-01-31"
73+
#define LIBCURL_TIMESTAMP "2024-03-27"
7474

7575
#define CURL_VERSION_BITS(x,y,z) ((x)<<16|(y)<<8|(z))
7676
#define CURL_AT_LEAST_VERSION(x,y,z) \

example/iOS Test App/include/openssl/configuration.h

-6
Original file line numberDiff line numberDiff line change
@@ -97,12 +97,6 @@ extern "C" {
9797
# ifndef OPENSSL_NO_SCTP
9898
# define OPENSSL_NO_SCTP
9999
# endif
100-
# ifndef OPENSSL_NO_SSL3
101-
# define OPENSSL_NO_SSL3
102-
# endif
103-
# ifndef OPENSSL_NO_SSL3_METHOD
104-
# define OPENSSL_NO_SSL3_METHOD
105-
# endif
106100
# ifndef OPENSSL_NO_TRACE
107101
# define OPENSSL_NO_TRACE
108102
# endif

0 commit comments

Comments
 (0)