DNS resolvable name of host to connect to. Exactly one of host and
address parameters must be specified.
- address
Numeric IP address of host to connect to. This should be in the
standard IPv4 address format. You can also use IPv6 if your machine
supports it. Exactly one of host and address parameters must be
specified.
- port
Port number to connect to at the server host.
- username
Username to connect as.
- password
Password to be used if the server demands password authentication.
- user_agent
Alternate name and version of the client to send to server. Default is
"MemgraphBolt/0.1".
- sslmode
This option determines whether a secure connection will be negotiated
with the server. There are 2 possible values:
- MG_SSLMODE_DISABLE
Only try a non-SSL connection (default).
- MG_SSLMODE_REQUIRE
Only try an SSL connection.
- sslcert
This parameter specifies the file name of the client SSL certificate.
It is ignored in case an SSL connection is not made.
- sslkey
This parameter specifies the location of the secret key used for the
client certificate. This parameter is ignored in case an SSL connection
is not made.
- trust_callback
A pointer to a function of prototype:
int trust_callback(const char *hostname, const char *ip_address,
const char *key_type, const char *fingerprint,
void *trust_data);
After performing the SSL handshake, mg_connect will call this
function providing the hostname, IP address, public key type and
fingerprint and user provided data. If the function returns a non-zero
value, SSL connection will be immediately terminated. This can be used
to implement TOFU (trust on first use) mechanism.
It might happen that hostname can not be determined, in that case the
trust callback will be called with hostname="undefined".
- trust_data
Additional data that will be provided to trust_callback function.
An object containing parameters for mg_connect.
Currently recognized parameters are: - host
DNS resolvable name of host to connect to. Exactly one of host and address parameters must be specified.
- address
Numeric IP address of host to connect to. This should be in the standard IPv4 address format. You can also use IPv6 if your machine supports it. Exactly one of host and address parameters must be specified.
- port
Port number to connect to at the server host.
- username
Username to connect as.
- password
Password to be used if the server demands password authentication.
- user_agent
Alternate name and version of the client to send to server. Default is "MemgraphBolt/0.1".
- sslmode
This option determines whether a secure connection will be negotiated with the server. There are 2 possible values:
- MG_SSLMODE_DISABLE
Only try a non-SSL connection (default).
- MG_SSLMODE_REQUIRE
Only try an SSL connection.
- sslcert
This parameter specifies the file name of the client SSL certificate. It is ignored in case an SSL connection is not made.
- sslkey
This parameter specifies the location of the secret key used for the client certificate. This parameter is ignored in case an SSL connection is not made.
- trust_callback
A pointer to a function of prototype: int trust_callback(const char *hostname, const char *ip_address, const char *key_type, const char *fingerprint, void *trust_data);
After performing the SSL handshake, mg_connect will call this function providing the hostname, IP address, public key type and fingerprint and user provided data. If the function returns a non-zero value, SSL connection will be immediately terminated. This can be used to implement TOFU (trust on first use) mechanism. It might happen that hostname can not be determined, in that case the trust callback will be called with hostname="undefined".
- trust_data
Additional data that will be provided to trust_callback function.