Skip to content
CheckcraftDownload
Practical workflow

HTTP request failed in 1C: causes and fixes

Checkcraft is a desktop app for checking APIs and logs without code, with a free edition. Download, no sign-up →

An HTTP request error in 1C is almost always a network problem, not a code problem: the host is not found, the port is closed, the server did not answer in time or the certificate check failed. The text after the colon comes from the network library and names the cause. Below is a breakdown by text and step-by-step checks.

Checkcraft ·

Get help with your first test →

First tell a network error from a server response

If Get or Post threw an exception, there was no response at all: the request did not arrive or did not come back. If an HTTPResponse with 400, 401, 404 or 500 came back, the network is fine and the server refused, so look at the code and body.

Check from the same server

The HTTP request runs where the code runs: on the 1C server for server calls and scheduled jobs. A check from your own browser says nothing about the 1C server. Run curl or ping from the 1C server machine under the same service account.

Which code the server returns: 400, 401, 403, 404, 415, 422, 500

When the error is intermittent

If the request sometimes passes and sometimes times out, the usual causes are service load, a small HTTPConnection timeout or a proxy. Log the request time and response to the event log to see whether the time grows before failures.

By error text

Text after the Internet error prefixMeaningCheck
Couldn't resolve host nameHost name not foundTypo, https:// in the server name, DNS on the 1C server
Couldn't connect to server, Failed to connectPort closed or unreachablePort, firewall, VPN, proxy
Timeout was reachedNo answer in timeHTTPConnection timeout, service load
SSL connect errorHTTPS handshake failedOpenSSLSecureConnection present, TLS version
Peer certificate cannot be authenticatedServer certificate not trustedCA certificates from the OS

The exact text varies by platform version, but it is always a message from the network library that runs the request.

API call diagram: method and URL, headers, body, status and response body, logs and database

If a proxy is needed

Прокси = Новый ИнтернетПрокси(Истина); // настройки прокси системы
Соединение = Новый HTTPСоединение("api.example.com", 443, , , Прокси, 60,
    Новый ЗащищенноеСоединениеOpenSSL(, Новый СертификатыУдостоверяющихЦентровОС));

Scheduled jobs run under the 1C server service account, which may have different proxy settings than the user. That is why a manual request from the client works and the job does not.

Logging to see the cause

Начало = ТекущаяУниверсальнаяДатаВМиллисекундах();
Попытка
    Ответ = Соединение.Получить(Запрос);
Исключение
    ЗаписьЖурналаРегистрации("Обмен.HTTP", УровеньЖурналаРегистрации.Ошибка, , ,
        СтрШаблон("Сеть: %1, адрес %2, %3 мс", КраткоеПредставлениеОшибки(ИнформацияОбОшибке()),
            Запрос.АдресРесурса, ТекущаяУниверсальнаяДатаВМиллисекундах() - Начало));
    ВызватьИсключение;
КонецПопытки;

Status codes when the network is fine

CodeExchange cause
400Wrong body or parameters: BOM, date format, empty field
401Missing or wrong auth, expired token
403Account lacks permissions
404Wrong path, service not published
500, 502, 503Error or outage on the service side

More on codes in 401 error and 500 error.

More on 1C

Section overview and all guides: 1C integration via API: options, architecture and examples.

Frequently asked questions

What does the Internet error mean in 1C?

The request did not reach the server or did not return: host not found, port closed, timeout or certificate check failure. The text after the colon names the cause.

Why does it work from the client but not in a scheduled job?

The job runs on the 1C server under the service account, with different network, proxy and certificates.

How do I fix a certificate error?

Pass the OS certificate authorities to OpenSSLSecureConnection.

Next step

Repeat this on your own API

Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.

Download FreeDownload and first run

No sign-up or email needed, the archive is ready in a couple of minutes. See the edition limits.

References

RFC 9110: HTTP semantics

Start with the linked example and compare its result with your own test requirement.

Ask a person

Get help with your first test

Tell us what you want to test or where you got stuck. We can help you start Checkcraft, choose an example and understand your first run. You can ask before downloading.

The Telegram group is public: do not post passwords, tokens or confidential work data. A description of your task is enough to start.

You can also email us support@checkcraft.ru

No account required. We will reply by email. This is a support request, not a newsletter subscription.