я пытаюсь сделать любой HTTPS запрос от моей программы winsock.
Я пришел к выводу, что мне нужно использовать какое-то SSL-соединение, но это слишком сложно сделать на пустом месте.
Итак, я нашел библиотеку <\ openssl.h>, получил пример для linux и попытался ее использовать.
Загрузил папку openssl из https://github.com/openssl/openssl/tree/master/include и вставил это в C:\MinGW\include
, но при компиляции (gcc clientHTTPS.c -o clientHTTPS.exe -l Ws2_32)
получить некоторые ошибки из include.
Есть какой-то пример win socket io, использующий другую SSL-библиотеку? Об ошибках, как я могу исправить?
Ошибки:
gcc clientHTTP.c -o clientHTTP.exe -l Ws2_32
In file included from c:\mingw\include\openssl\opensslconf.h:13,
from c:\mingw\include\openssl\macros.h:10,
from c:\mingw\include\openssl\ssl.h:16,
from clientHTTP.c:3:
c:\mingw\include\openssl\configuration.h:27:1: error: expected identifier or '(' before '{' token
{- if (@{$config{openssl_sys_defines}}) {
^
c:\mingw\include\openssl\configuration.h:27:8: error: stray '@' in program
{- if (@{$config{openssl_sys_defines}}) {
^
c:\mingw\include\openssl\configuration.h:28:16: error: stray '@' in program
foreach (@{$config{openssl_sys_defines}}) {
^
c:\mingw\include\openssl\configuration.h:34:14: error: stray '@' in program
foreach (@{$config{openssl_api_defines}}) {
^
c:\mingw\include\openssl\configuration.h:38:9: error: stray '@' in program
if (@{$config{openssl_feature_defines}}) {
^
c:\mingw\include\openssl\configuration.h:39:16: error: stray '@' in program
foreach (@{$config{openssl_feature_defines}}) {
^
c:\mingw\include\openssl\configuration.h:49:1: error: expected identifier or '(' before '{' token
{- $config{processor} eq "386" ? "# define" : "# undef" -} I386_ONLY
^
c:\mingw\include\openssl\configuration.h:55:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
{- $config{bn_ll} ? "# define" : "# undef" -} BN_LLONG
^
c:\mingw\include\openssl\configuration.h:57:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
{- $config{b64l} ? "# define" : "# undef" -} SIXTY_FOUR_BIT_LONG
^
c:\mingw\include\openssl\configuration.h:58:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
{- $config{b64} ? "# define" : "# undef" -} SIXTY_FOUR_BIT
^
c:\mingw\include\openssl\configuration.h:59:1: error: expected '=', ',', ';', 'asm' or '__attribute__' before '{' token
{- $config{b32} ? "# define" : "# undef" -} THIRTY_TWO_BIT
^
In file included from c:\mingw\include\openssl\macros.h:11,
from c:\mingw\include\openssl\opensslconf.h:14,
from c:\mingw\include\openssl\macros.h:10,
from c:\mingw\include\openssl\ssl.h:16,
from clientHTTP.c:3:
c:\mingw\include\openssl\macros.h:104:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL > OPENSSL_CONFIGURED_API
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:112:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL > (OPENSSL_VERSION_MAJOR * 10000 + OPENSSL_VERSION_MINOR * 100)
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:116:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL < 30000 && OPENSSL_API_LEVEL >= 20000
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:120:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL < 908
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:139:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL >= 30000
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:149:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL >= 10101
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:159:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL >= 10100
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:169:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL >= 10002
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:179:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL >= 10001
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:189:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL >= 10000
^~~~~~~~~~~~~~~~~
c:\mingw\include\openssl\macros.h:199:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL >= 908
^~~~~~~~~~~~~~~~~
In file included from c:\mingw\include\openssl\opensslconf.h:13,
from c:\mingw\include\openssl\macros.h:10,
from c:\mingw\include\openssl\ssl.h:16,
from clientHTTP.c:3:
c:\mingw\include\openssl\configuration.h:59:62: error: expected ';' before 'typedef'
{- $config{b32} ? "# define" : "# undef" -} THIRTY_TWO_BIT
^
;
In file included from c:\mingw\include\openssl\params.h:15,
from c:\mingw\include\openssl\evp.h:27,
from c:\mingw\include\openssl\x509.h:24,
from c:\mingw\include\openssl\ssl.h:26,
from clientHTTP.c:3:
c:\mingw\include\openssl\bn.h:191:43: error: unknown type name 'BN_ULONG'
int BN_abs_is_word(const BIGNUM *a, const BN_ULONG w);
^~~~~~~~
c:\mingw\include\openssl\bn.h:194:39: error: unknown type name 'BN_ULONG'
int BN_is_word(const BIGNUM *a, const BN_ULONG w);
^~~~~~~~
In file included from c:\mingw\include\openssl\macros.h:11,
from c:\mingw\include\openssl\opensslconf.h:14,
from c:\mingw\include\openssl\macros.h:10,
from c:\mingw\include\openssl\ssl.h:16,
from clientHTTP.c:3:
c:\mingw\include\openssl\bn.h:201:6: error: token "{" is not valid in preprocessor expressions
# if OPENSSL_API_LEVEL > 908
^~~~~~~~~~~~~~~~~
In file included from c:\mingw\include\openssl\params.h:15,
from c:\mingw\include\openssl\evp.h:27,
from c:\mingw\include\openssl\x509.h:24,
from c:\mingw\include\openssl\ssl.h:26,
from clientHTTP.c:3:
c:\mingw\include\openssl\bn.h:228:22: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
int BN_num_bits_word(BN_ULONG l);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:282:1: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:282:39: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
BN_ULONG BN_mod_word(const BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:283:1: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:283:33: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
BN_ULONG BN_div_word(BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:284:28: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
int BN_mul_word(BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:285:28: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
int BN_add_word(BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:286:28: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
int BN_sub_word(BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:287:28: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
int BN_set_word(BIGNUM *a, BN_ULONG w);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:288:1: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
BN_ULONG BN_get_word(const BIGNUM *a);
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:304:37: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
int BN_mod_exp_mont_word(BIGNUM *r, BN_ULONG a, const BIGNUM *p,
^~~~~~~~
PULONG
c:\mingw\include\openssl\bn.h:339:24: error: unknown type name 'BN_ULONG'; did you mean 'PULONG'?
void BN_consttime_swap(BN_ULONG swap, BIGNUM *a, BIGNUM *b, int nwords);
^~~~~~~~
PULONG