hierynomus / smbj

Server Message Block (SMB2, SMB3) implementation in Java
Other
705 stars 179 forks source link

STATUS_ACCESS_DENIED(3221225506/3221225506): Could not connect to <smb drive folder path> #803

Open kadirchisty opened 9 months ago

kadirchisty commented 9 months ago

After activating SMB data-in-transit encryption on smb shares, we are facing below error from SMBJ jar.

STATUS_ACCESS_DENIED(3221225506/3221225506): Could not connect to com.hierynomus.mssmb2.SMBApiException: STATUS_ACCESS_DENIED(3221225506/3221225506): Could not connect to at com.hierynomus.smbj.session.Session.connectTree(Session.java:169) ~[smbj-0.6.0.jar:0.6.0] at com.hierynomus.smbj.session.Session.connectShare(Session.java:139) ~[smbj-0.6.0.jar:0.6.0]

Recommendation is to use SMB 3.0 protocol.

Any help on how we can make use of SMB 3.0 protocol with smbj jar is much appreciated.

hierynomus commented 9 months ago

What is the SmbConfig you're using?

kadirchisty commented 9 months ago

Hi @hierynomus,

SmbConfig.builder().withDfsEnabled(true).withMultiProtocolNegotiate(true).build();

kadirchisty commented 8 months ago

@hierynomus - Please let's know incase of any updates

hierynomus commented 8 months ago

Have you tried adding withEncryption(true) to the SmbConfig?

kadirchisty commented 8 months ago

@hierynomus Thanks for quick response. With above change in smbjConfig and upgrading to latest smbj library version, it is connecting without issues.