Created attachment 177493 [details]
Please update libssh2 to the latest version - 1.8.0.
files/patch-configure is needed to fix build with GCRYPT option (bug fixed by upstream in git after 1.8.0 release).
In 1.8.0 support of mbedTLS backend was added. It was not added as port option in my patch because it is not clear how to do this in backward compatible way.
Given that now there are three crypto backends we can write something like:
OPTIONS_SINGLE_CRYPTO= OPENSSL GCRYPT MBEDTLS
But if libssh2 was build with GCRYPT option on update option dialog will be shown with OPENSSL option selected by default. If BATCH=yes is used port update will stop with error. I think it is better to not add new crypto backed (while not requested by users), than break existing installations. If there is a backward compatible way to move GCRYPT from OPTIONS_DEFINE to OPTIONS_SINGLE_CRYPTO I'd like to know.
Build of port with default options was tested using poudriere:
This patch LGTM. I would like to avoid to add a new patch into FILESDIR to stay closer to upstream but I found the reported issue upstream , so I think we can't avoid this patch addition because the 1.8.0 release was done before the fix 
A commit references this bug:
Date: Wed Dec 14 17:03:16 UTC 2016
New revision: 428573
- Update to 1.8.0
Submitted by: Anton Yuzhaninov <citrin+pr at citrin.ru>
Committed in r428573. Thank you!