If I launch webhook-bot behind SOCKS5-proxy, I get following error:
Exception in thread "main" java.lang.NullPointerException
at org.telegram.telegrambots.facilities.proxysocketfactorys.SocksSSLConnectionSocketFactory.createSocket(SocksSSLConnectionSocketFactory.java:25)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:119)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:359)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:381)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:237)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:185)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:89)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:111)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:83)
at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:108)
at org.telegram.telegrambots.util.WebhookUtils.setWebhook(WebhookUtils.java:56)
at org.telegram.telegrambots.bots.TelegramWebhookBot.setWebhook(TelegramWebhookBot.java:26)
at org.telegram.telegrambots.meta.TelegramBotsApi.registerBot(TelegramBotsApi.java:136)
at ru.krivochenko.Main.main(Main.java:40)
I guess it happens because WebhookUtils executes request without passing httpContext:
Hi, everyone!
If I launch webhook-bot behind SOCKS5-proxy, I get following error:
I guess it happens because WebhookUtils executes request without passing httpContext:
So new context is created without properties
socketAddress
andsocksVersion
.P.S. If I set webhook manually by third-party http-client, bot receives updates and can answer on it.