Commit 3cd3103a6e2d3dcd4004654a78ee0a3bc10f0b66
1 parent
97080b25
Exists in
master
and in
3 other branches
Adding method to get SSL definition.
Showing
4 changed files
with
27 additions
and
1 deletions
Show diff stats
lib3270.cbp
| ... | ... | @@ -57,7 +57,6 @@ |
| 57 | 57 | <Unit filename="src/include/ft_dft_ds.h" /> |
| 58 | 58 | <Unit filename="src/include/ft_dftc.h" /> |
| 59 | 59 | <Unit filename="src/include/ftc.h" /> |
| 60 | - <Unit filename="src/include/gluec.h" /> | |
| 61 | 60 | <Unit filename="src/include/hostc.h" /> |
| 62 | 61 | <Unit filename="src/include/icmdc.h" /> |
| 63 | 62 | <Unit filename="src/include/keypadc.h" /> | ... | ... |
src/include/lib3270.h
| ... | ... | @@ -484,6 +484,13 @@ |
| 484 | 484 | |
| 485 | 485 | LIB3270_EXPORT void lib3270_set_hostname(H3270 *h, const char *hostname); |
| 486 | 486 | |
| 487 | + /** | |
| 488 | + * @brief Get SSL host option. | |
| 489 | + * | |
| 490 | + * @return Non zero if the host URL has SSL scheme. | |
| 491 | + * | |
| 492 | + */ | |
| 493 | + LIB3270_EXPORT int lib3270_get_secure_host(H3270 *hSession); | |
| 487 | 494 | |
| 488 | 495 | /** |
| 489 | 496 | * @brief Get service or port for the connect/reconnect operations. | ... | ... |
src/lib3270/properties.c
| ... | ... | @@ -584,3 +584,22 @@ int lib3270_set_string_property(H3270 *hSession, const char *name, const char * |
| 584 | 584 | return -1; |
| 585 | 585 | |
| 586 | 586 | } |
| 587 | + | |
| 588 | +/** | |
| 589 | + * @brief Get SSL host option. | |
| 590 | + * | |
| 591 | + * @return Non zero if the host URL has SSL scheme. | |
| 592 | + * | |
| 593 | + */ | |
| 594 | +LIB3270_EXPORT int lib3270_get_secure_host(H3270 *hSession) | |
| 595 | +{ | |
| 596 | + CHECK_SESSION_HANDLE(hSession); | |
| 597 | + | |
| 598 | +#ifdef HAVE_LIBSSL | |
| 599 | + return hSession->ssl.enabled ? 1 : 0; | |
| 600 | +#else | |
| 601 | + return 0; | |
| 602 | +#endif // HAVE_LIBSSL | |
| 603 | + | |
| 604 | +} | |
| 605 | + | ... | ... |