lm_ssl.c
changeset 62 d92358eafead
parent 59 19cfaceda6bb
equal deleted inserted replaced
61:745b73f91607 62:d92358eafead
   170 #ifdef HAVE_LM_SSL_SET_CA
   170 #ifdef HAVE_LM_SSL_SET_CA
   171 /// ssl:ca_path
   171 /// ssl:ca_path
   172 /// Set path to trusted ssl certificates. Argument must be a name of a PEM file
   172 /// Set path to trusted ssl certificates. Argument must be a name of a PEM file
   173 /// or a name of directory with hashed certificates.
   173 /// or a name of directory with hashed certificates.
   174 /// A: string (path)
   174 /// A: string (path)
       
   175 /// R: lm ssl object
   175 static int ca_path_lm_ssl (lua_State *L)
   176 static int ca_path_lm_ssl (lua_State *L)
   176 {
   177 {
   177 	llm_ssl_t *object = luaL_checklm_ssl (L, 1);
   178 	llm_ssl_t *object = luaL_checklm_ssl (L, 1);
   178 	const gchar *path = luaL_checkstring (L, 2);
   179 	const gchar *path = luaL_checkstring (L, 2);
   179 	lm_ssl_set_ca (object -> ssl, path);
   180 	lm_ssl_set_ca (object -> ssl, path);
   180 	return 0;
   181 	lua_pop (L, 1);
       
   182 	return 1;
   181 }
   183 }
   182 #endif
   184 #endif
   183 
   185 
   184 #ifdef HAVE_LM_SSL_SET_CIPHER_LIST
   186 #ifdef HAVE_LM_SSL_SET_CIPHER_LIST
   185 /// ssl:cipher_list
   187 /// ssl:cipher_list
   186 /// Set list of allowed ciphers (colon-separated). Names may vary depending on ssl
   188 /// Set list of allowed ciphers (colon-separated). Names may vary depending on ssl
   187 /// implementation in use.
   189 /// implementation in use.
   188 /// A: string (cipher list)
   190 /// A: string (cipher list)
       
   191 /// R: lm ssl object
   189 static int cipher_list_lm_ssl (lua_State *L)
   192 static int cipher_list_lm_ssl (lua_State *L)
   190 {
   193 {
   191 	llm_ssl_t *object = luaL_checklm_ssl (L, 1);
   194 	llm_ssl_t *object = luaL_checklm_ssl (L, 1);
   192 	const gchar *list = luaL_checkstring (L, 2);
   195 	const gchar *list = luaL_checkstring (L, 2);
   193 	lm_ssl_set_cipher_list (object -> ssl, list);
   196 	lm_ssl_set_cipher_list (object -> ssl, list);
   194 	return 0;
   197 	lua_pop (L, 1);
       
   198 	return 1;
   195 }
   199 }
   196 #endif
   200 #endif
   197 
   201 
   198 /// ssl:fingerprint
   202 /// ssl:fingerprint
   199 /// Returns fingerprint of remote server.
   203 /// Returns fingerprint of remote server.