Skip to content

Commit b3342dc

Browse files
committed
Improved connect in mixed IPv4/IPv6 environments and improved TLS connections without a root certificate.
Other internal improvements.
1 parent 0c9e926 commit b3342dc

File tree

3 files changed

+507
-433
lines changed

3 files changed

+507
-433
lines changed

C_SDK/csql.h

100644100755
+12-8
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ typedef unsigned long in_addr_t;
175175
#define kMAXCHUNK 100*1024
176176
#define NO_TIMEOUT 0
177177
#define CONNECT_TIMEOUT 5
178-
178+
179179
#if defined(HAVE_BZERO) || defined(bzero)
180180
// do nothing
181181
#else
@@ -208,13 +208,17 @@ int tls_close(struct tls *_ctx);
208208
int tls_config_set_ca_file(struct tls_config *_config, const char *_ca_file);
209209
int tls_config_set_cert_file(struct tls_config *_config,const char *_cert_file);
210210
int tls_config_set_key_file(struct tls_config *_config, const char *_key_file);
211+
void tls_config_insecure_noverifycert(struct tls_config* config);
212+
void tls_config_insecure_noverifyname(struct tls_config* config);
213+
int tls_config_set_ciphers(struct tls_config *config, const char *ciphers);
211214
ssize_t tls_read(struct tls *_ctx, void *_buf, size_t _buflen);
212215
ssize_t tls_write(struct tls *_ctx, const void *_buf, size_t _buflen);
213216
const char *tls_error(struct tls *_ctx);
214217
const char *tls_config_error(struct tls_config *_config);
215218
void tls_free(struct tls *_ctx);
219+
const char* SSLeay_version(int t);
216220
#endif
217-
221+
218222
/* COMMANDS */
219223
#define kCOMMAND_CONNECT 1
220224
#define kCOMMAND_SELECT 2
@@ -306,14 +310,14 @@ struct csqldb {
306310
int errcode; // last error code
307311
int useOldProtocol; // flag to set if you want to use the old REALSQLServer protocol
308312
int verifyPeer; // flag to check if peer verification must be performed
309-
int family;
313+
int family;
310314

311315
char *token; // optional token used in token connect
312316
char *hostverification; // optional host verification name to use in SSL peer verification
313317
void *userptr; // optional pointer saved by the user
314318
int encryption; // CUBESQL_ENCRYPTION_NONE - CUBESQL_ENCRYPTION_AES128
315-
// CUBESQL_ENCRYPTION_AES192 - CUBESQL_ENCRYPTION_AES256
316-
319+
// CUBESQL_ENCRYPTION_AES192 - CUBESQL_ENCRYPTION_AES256
320+
317321
csql_aes_encrypt_ctx encryptkey[1]; // session key used to encrypt data
318322
csql_aes_decrypt_ctx decryptkey[1]; // session key used to decrypt data
319323

@@ -324,9 +328,9 @@ struct csqldb {
324328
inhead request; // request header
325329
outhead reply; // response header
326330

327-
#ifndef CUBESQL_DISABLE_SSL_ENCRYPTION
328-
struct tls *tls_context; // TLS context connection
329-
#endif
331+
#ifndef CUBESQL_DISABLE_SSL_ENCRYPTION
332+
struct tls *tls_context; // TLS context connection
333+
#endif
330334

331335
void (*trace) (const char*, void*); // trace callback
332336
void *data; // user argument to be passed to the callbacks function

0 commit comments

Comments
 (0)