sharepoint online connection reset

Ye, Peng 1 Reputation point
2021-11-22T06:01:21.387+00:00

I have a java program to download file from sharepoint 2010 with NTLM Authentication, it worked well. But when I use this code to download another file from a sharepoint online site, it throws following exception. Does someone have any idea? Thanks.

2021-11-22 10:46:16,269 INFO [org.apache.http.impl.execchain.RetryExec:96] - I/O exception (java.net.SocketException) caught when processing request to {s}->https://xxx.sharepoint.com:443: Connection reset
2021-11-22 10:46:16,269 INFO [org.apache.http.impl.execchain.RetryExec:112] - Retrying request to {s}->https://xxx.sharepoint.com:443
Exception in thread "main" java.net.SocketException: Connection reset
at java.net.SocketInputStream.read(Unknown Source)
at java.net.SocketInputStream.read(Unknown Source)
at sun.security.ssl.InputRecord.readFully(Unknown Source)
at sun.security.ssl.InputRecord.read(Unknown Source)
at sun.security.ssl.SSLSocketImpl.readRecord(Unknown Source)
at sun.security.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at sun.security.ssl.SSLSocketImpl.startHandshake(Unknown Source)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.createLayeredSocket(SSLConnectionSocketFactory.java:394)
at org.apache.http.conn.ssl.SSLConnectionSocketFactory.connectSocket(SSLConnectionSocketFactory.java:353)
at org.apache.http.impl.conn.DefaultHttpClientConnectionOperator.connect(DefaultHttpClientConnectionOperator.java:141)
at org.apache.http.impl.conn.PoolingHttpClientConnectionManager.connect(PoolingHttpClientConnectionManager.java:353)
at org.apache.http.impl.execchain.MainClientExec.establishRoute(MainClientExec.java:380)
at org.apache.http.impl.execchain.MainClientExec.execute(MainClientExec.java:236)
at org.apache.http.impl.execchain.ProtocolExec.execute(ProtocolExec.java:184)
at org.apache.http.impl.execchain.RetryExec.execute(RetryExec.java:88)
at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:110)
at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:184)

SharePoint
SharePoint
A group of Microsoft Products and technologies used for sharing and managing content, knowledge, and applications.
9,849 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. RaytheonXie_MSFT 32,166 Reputation points Microsoft Vendor
    2021-11-23T02:22:53.86+00:00

    Hi @Ye, Peng ,
    NTLM Authentication only support sharepoint on-premise but not sharepoint online. Please refer to following document.
    https://learn.microsoft.com/en-us/sharepoint/security-for-sharepoint-server/plan-user-authentication
    Since java is out of support scope. I can only provide some similar issue for you:
    https://techcommunity.microsoft.com/t5/sharepoint-developer/how-to-connect-to-sharepoint-online-site-to-upload-and-download/m-p/1090942


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.