- 浏览: 192353 次
- 性别:
文章分类
最新评论
-
路人甲wxf:
.net可以在不使用证书的情况下修改密码,java做不到吗?
添加用户、修改ad密码 -
zxsosozhuzhu:
你好,我也遇到这个问题了,但是按照你的方法还是附件中文还是乱码 ...
java mail 纯文本附件乱码的解决方案 -
balaschen:
can4you 写道 请教问题:你好,请教一个问题,我现在要模 ...
spring2.0事务配置实验 -
can4you:
/**
* Created: 2007-2-1
* ...
FreeMarker解析字符串模板 -
can4you:
请教问题:你好,请教一个问题,我现在要模拟两个事务同时更新一 ...
spring2.0事务配置实验
java 代码
- /**
- *
- */
- package ldap;
- import java.util.Properties;
- import javax.naming.*;
- import javax.naming.ldap.*;
- import javax.naming.directory.*;
- /**
- * @author Keven Chen
- * @version $Revision 1.0 $
- *
- */
- public class AddAdUser {
- private static final String SUN_JNDI_PROVIDER = "com.sun.jndi.ldap.LdapCtxFactory";
- public static void main(String[] args) throws Exception {
- String keystore = "F:\\jdk1.5.0_08\\jre\\lib\\security\\cacerts";
- System.setProperty("javax.net.ssl.trustStore", keystore);
- Properties env = new Properties();
- env.put(Context.INITIAL_CONTEXT_FACTORY, SUN_JNDI_PROVIDER);// java.naming.factory.initial
- env.put(Context.PROVIDER_URL, "ldap://192.168.1.32:636");// java.naming.provider.url
- env.put(Context.SECURITY_AUTHENTICATION, "simple");// java.naming.security.authentication
- env.put(Context.SECURITY_PRINCIPAL,
- "cn=Administrator,cn=Users,dc=comwave,dc=com");// java.naming.security.principal
- env.put(Context.SECURITY_CREDENTIALS, "password");// java.naming.security.credentials
- env.put(Context.SECURITY_PROTOCOL, "ssl");
- String userName = "CN=test,CN=Users,DC=comwave,DC=com";
- String groupName = "CN=Domain Admins,CN=Users,DC=comwave,DC=com";
- LdapContext ctx = new InitialLdapContext(env, null);
- // Create attributes to be associated with the new user
- Attributes attrs = new BasicAttributes(true);
- // These are the mandatory attributes for a user object
- // Note that Win2K3 will automagically create a random
- // samAccountName if it is not present. (Win2K does not)
- attrs.put("objectClass", "user");
- attrs.put("sAMAccountName", "test");
- attrs.put("cn", "test");
- // These are some optional (but useful) attributes
- attrs.put("sn", "test");
- attrs.put("displayName", "test");
- attrs.put("description", "测试");
- attrs.put("userPrincipalName", "test@comwave.com");
- attrs.put("mail", "test@comwave.com");
- attrs.put("telephoneNumber", "1234568999");
- // some useful constants from lmaccess.h
- int UF_ACCOUNTDISABLE = 0x0002;
- int UF_PASSWD_NOTREQD = 0x0020;
- int UF_PASSWD_CANT_CHANGE = 0x0040;
- int UF_NORMAL_ACCOUNT = 0x0200;
- int UF_DONT_EXPIRE_PASSWD = 0x10000;
- int UF_PASSWORD_EXPIRED = 0x800000;
- // Note that you need to create the user object before you can
- // set the password. Therefore as the user is created with no
- // password, user AccountControl must be set to the following
- // otherwise the Win2K3 password filter will return error 53
- // unwilling to perform.
- attrs.put("userAccountControl", Integer.toString(UF_NORMAL_ACCOUNT
- + UF_PASSWD_NOTREQD + UF_PASSWORD_EXPIRED + UF_ACCOUNTDISABLE));
- // Create the context
- Context result = ctx.createSubcontext(userName, attrs);
- System.out.println("Created disabled account for: " + userName);
- ModificationItem[] mods = new ModificationItem[2];
- // Replace the "unicdodePwd" attribute with a new value
- // Password must be both Unicode and a quoted string
- String newQuotedPassword = "\"Password2000\"";
- byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
- mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
- new BasicAttribute("unicodePwd", newUnicodePassword));
- mods[1] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE,
- new BasicAttribute("userAccountControl", Integer
- .toString(UF_NORMAL_ACCOUNT + UF_PASSWORD_EXPIRED)));
- // Perform the update
- ctx.modifyAttributes(userName, mods);
- System.out.println("Set password & updated userccountControl");
- // now add the user to a group.
- try {
- ModificationItem member[] = new ModificationItem[1];
- member[0] = new ModificationItem(DirContext.ADD_ATTRIBUTE,
- new BasicAttribute("member", userName));
- ctx.modifyAttributes(groupName, member);
- System.out.println("Added user to group: " + groupName);
- } catch (NamingException e) {
- System.err.println("Problem adding user to group: " + e);
- }
- // Could have put tls.close() prior to the group modification
- // but it seems to screw up the connection or context ?
- ctx.close();
- System.out.println("Successfully created User: " + userName);
- }
- }
java 代码
- /**
- *
- */
- package ldap;
- import java.io.IOException;
- import java.io.UnsupportedEncodingException;
- import java.util.Hashtable;
- import javax.naming.Context;
- import javax.naming.NamingException;
- import javax.naming.directory.BasicAttribute;
- import javax.naming.directory.DirContext;
- import javax.naming.directory.ModificationItem;
- import javax.naming.ldap.InitialLdapContext;
- import javax.naming.ldap.LdapContext;
- import javax.naming.ldap.StartTlsRequest;
- import javax.naming.ldap.StartTlsResponse;
- /**
- * @author Keven Chen
- * @version $Revision 1.0 $
- *
- */
- public class UpdatePasswordTLS {
- public static void main (String[] args)
- {
- Hashtable env = new Hashtable();
- String adminName = "CN=Administrator,CN=Users,DC=comwave,DC=com";
- String adminPassword = "aadsasdfasd";
- String userName = "CN=keven,CN=Users,DC=comwave,DC=com";
- String newPassword = "aaaaaaaa";
- String keystore = "F:\\jdk1.5.0_08\\jre\\lib\\security\\cacerts";
- System.setProperty("javax.net.ssl.trustStore",keystore);
- //Access the keystore, this is where the Root CA public key cert was installed
- //Could also do this via command line java -Djavax.net.ssl.trustStore....
- //String keystore = "/usr/java/jdk1.5.0_01/jre/lib/security/cacerts";
- //System.setProperty("javax.net.ssl.trustStore",keystore);
- env.put(Context.INITIAL_CONTEXT_FACTORY,"com.sun.jndi.ldap.LdapCtxFactory");
- //set security credentials, note using simple cleartext authentication
- env.put(Context.SECURITY_AUTHENTICATION,"simple");
- env.put(Context.SECURITY_PRINCIPAL,adminName);
- env.put(Context.SECURITY_CREDENTIALS,adminPassword);
- env.put(Context.SECURITY_PROTOCOL,"ssl");
- //connect to my domain controller
- String ldapURL = "ldap://192.168.1.32:636";
- env.put(Context.PROVIDER_URL,ldapURL);
- try {
- // Create the initial directory context
- LdapContext ctx = new InitialLdapContext(env,null);
- //set password is a ldap modfy operation
- ModificationItem[] mods = new ModificationItem[1];
- //Replace the "unicdodePwd" attribute with a new value
- //Password must be both Unicode and a quoted string
- String newQuotedPassword = "\"" + newPassword + "\"";
- byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
- //注意:如果是当前用户自行修改密码,需要先删除oldpassword,然后在添加新的password
- /*
- ModificationItem[] mods = new ModificationItem[2];
- //Firstly delete the "unicdodePwd" attribute, using the old password
- //Then add the new password,Passwords must be both Unicode and a quoted string
- String oldQuotedPassword = "\"" + sOldPassword + "\"";
- byte[] oldUnicodePassword = oldQuotedPassword.getBytes("UTF-16LE");
- String newQuotedPassword = "\"" + sNewPassword + "\"";
- byte[] newUnicodePassword = newQuotedPassword.getBytes("UTF-16LE");
- mods[0] = new ModificationItem(DirContext.REMOVE_ATTRIBUTE, new BasicAttribute("unicodePwd", oldUnicodePassword));
- mods[1] = new ModificationItem(DirContext.ADD_ATTRIBUTE, new BasicAttribute("unicodePwd", newUnicodePassword));
- // Perform the update
- ctx.modifyAttributes(sUserName, mods);
- */
- mods[0] = new ModificationItem(DirContext.REPLACE_ATTRIBUTE, new BasicAttribute("unicodePwd", newUnicodePassword));
- // Perform the update
- ctx.modifyAttributes(userName, mods);
- System.out.println("Reset Password for: " + userName);
- ctx.close();
- }
- catch (NamingException e) {
- System.out.println("Problem resetting password: " + e);
- }
- catch (UnsupportedEncodingException e) {
- System.out.println("Problem encoding password: " + e);
- }
- catch (IOException e) {
- System.out.println("Problem with TLS: " + e);
- }
- }
- }
评论
9 楼
路人甲wxf
2014-05-26
.net可以在不使用证书的情况下修改密码,java做不到吗?
8 楼
Leecupn
2009-08-21
是的,确实是证书没正确导入。后来我解决了。
请问,我能不能添加或删除一个Group呢???
你做过相关项目吗?
还有,一定要通过
String keystore = "F:\\jdk1.5.0_08\\jre\\lib\\security\\cacerts";
System.setProperty("javax.net.ssl.trustStore", keystore);
这种方式来导入证书吗?还有其他方式没有啊?
请问,我能不能添加或删除一个Group呢???
你做过相关项目吗?
还有,一定要通过
String keystore = "F:\\jdk1.5.0_08\\jre\\lib\\security\\cacerts";
System.setProperty("javax.net.ssl.trustStore", keystore);
这种方式来导入证书吗?还有其他方式没有啊?
7 楼
balaschen
2009-08-19
应该是证书没正确导入到keyStord指定的位置
6 楼
balaschen
2009-08-19
你这明显是SSL没配置好。
5 楼
Leecupn
2009-08-17
你好,我用你的方法,但是不知道怎么搞的,报以下异常:
Exception in thread "main" javax.naming.CommunicationException: simple bind failed: 192.168.136.202:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
at com.sun.jndi.ldap.LdapClient.authenticate(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source)
at com.zony.ldap2.AddAdUser.main(AddAdUser.java:29)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at com.sun.jndi.ldap.Connection.writeRequest(Unknown Source)
at com.sun.jndi.ldap.LdapClient.ldapBind(Unknown Source)
... 12 more
能帮助我吗??
谢谢
Exception in thread "main" javax.naming.CommunicationException: simple bind failed: 192.168.136.202:636 [Root exception is javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target]
at com.sun.jndi.ldap.LdapClient.authenticate(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source)
at com.zony.ldap2.AddAdUser.main(AddAdUser.java:29)
Caused by: javax.net.ssl.SSLHandshakeException: sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
at com.sun.net.ssl.internal.ssl.Alerts.getSSLException(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.fatal(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.fatalSE(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.serverCertificate(Unknown Source)
at com.sun.net.ssl.internal.ssl.ClientHandshaker.processMessage(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.processLoop(Unknown Source)
at com.sun.net.ssl.internal.ssl.Handshaker.process_record(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at com.sun.jndi.ldap.Connection.writeRequest(Unknown Source)
at com.sun.jndi.ldap.LdapClient.ldapBind(Unknown Source)
... 12 more
能帮助我吗??
谢谢
4 楼
Fire_Wings
2009-04-01
wls981 写道
您好,我也用java通过LDAP修改AD的用户密码,我是用admin修改其他用户的密码的,但是报下面的错误,我导入证书了:Exception in thread "main" javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000001F: SvcErr: DSID-031A0FC0, problem 5003 (WILL_NOT_PERFORM), data 0]; remaining name 'cn=wls,cn=Users,dc=gnt,dc=com,dc=cn' at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3078) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951) at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758) at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(LdapCtx.java:1441) at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(ComponentDirContext.java:255) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:172) at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:161) at javax.naming.directory.InitialDirContext.modifyAttributes(InitialDirContext.java:148) at test.LdapOperator.changePassword(LdapOperator.java:166) at test.LdapOperator.main(LdapOperator.java:334)请问会是什么原因引起的,我新增用户,修改用户的属性都没有问题,唯独修改密码不行。谢谢!
你的密码不符合密码策略,换个符合策略的密码就行了,我也遇到了这种情况,换个密码是一种解决方案
3 楼
wls981
2009-01-12
您好,我也用java通过LDAP修改AD的用户密码,我是用admin修改其他用户的密码的,但是报下面的错误,我导入证书了:
Exception in thread "main" javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000001F: SvcErr: DSID-031A0FC0, problem 5003 (WILL_NOT_PERFORM), data 0]; remaining name 'cn=wls,cn=Users,dc=gnt,dc=com,dc=cn'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3078)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758)
at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(LdapCtx.java:1441)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(ComponentDirContext.java:255)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:172)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:161)
at javax.naming.directory.InitialDirContext.modifyAttributes(InitialDirContext.java:148)
at test.LdapOperator.changePassword(LdapOperator.java:166)
at test.LdapOperator.main(LdapOperator.java:334)
请问会是什么原因引起的,我新增用户,修改用户的属性都没有问题,唯独修改密码不行。
谢谢!
Exception in thread "main" javax.naming.OperationNotSupportedException: [LDAP: error code 53 - 0000001F: SvcErr: DSID-031A0FC0, problem 5003 (WILL_NOT_PERFORM), data 0]; remaining name 'cn=wls,cn=Users,dc=gnt,dc=com,dc=cn'
at com.sun.jndi.ldap.LdapCtx.mapErrorCode(LdapCtx.java:3078)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2951)
at com.sun.jndi.ldap.LdapCtx.processReturnCode(LdapCtx.java:2758)
at com.sun.jndi.ldap.LdapCtx.c_modifyAttributes(LdapCtx.java:1441)
at com.sun.jndi.toolkit.ctx.ComponentDirContext.p_modifyAttributes(ComponentDirContext.java:255)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:172)
at com.sun.jndi.toolkit.ctx.PartialCompositeDirContext.modifyAttributes(PartialCompositeDirContext.java:161)
at javax.naming.directory.InitialDirContext.modifyAttributes(InitialDirContext.java:148)
at test.LdapOperator.changePassword(LdapOperator.java:166)
at test.LdapOperator.main(LdapOperator.java:334)
请问会是什么原因引起的,我新增用户,修改用户的属性都没有问题,唯独修改密码不行。
谢谢!
2 楼
balaschen
2008-09-04
你AD Server的SSL配置没配好吧,netstat查看有没有打开636端口号
1 楼
haidii
2008-08-20
你好,我用你的方法,不知道怎么搞的,报以下异常:
Exception in thread "main" javax.naming.CommunicationException: simple bind failed: localhost:636 [Root exception is javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake]
at com.sun.jndi.ldap.LdapClient.authenticate(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source)
at ldap.AddAdUser.main(AddAdUser.java:34)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at com.sun.jndi.ldap.Connection.writeRequest(Unknown Source)
at com.sun.jndi.ldap.LdapClient.ldapBind(Unknown Source)
... 12 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
... 20 more
你能帮助我吗??
谢谢!
Exception in thread "main" javax.naming.CommunicationException: simple bind failed: localhost:636 [Root exception is javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake]
at com.sun.jndi.ldap.LdapClient.authenticate(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.connect(Unknown Source)
at com.sun.jndi.ldap.LdapCtx.<init>(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURL(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getUsingURLs(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getLdapCtxInstance(Unknown Source)
at com.sun.jndi.ldap.LdapCtxFactory.getInitialContext(Unknown Source)
at javax.naming.spi.NamingManager.getInitialContext(Unknown Source)
at javax.naming.InitialContext.getDefaultInitCtx(Unknown Source)
at javax.naming.InitialContext.init(Unknown Source)
at javax.naming.ldap.InitialLdapContext.<init>(Unknown Source)
at ldap.AddAdUser.main(AddAdUser.java:34)
Caused by: javax.net.ssl.SSLHandshakeException: Remote host closed connection during handshake
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(Unknown Source)
at com.sun.net.ssl.internal.ssl.SSLSocketImpl.writeRecord(Unknown Source)
at com.sun.net.ssl.internal.ssl.AppOutputStream.write(Unknown Source)
at java.io.BufferedOutputStream.flushBuffer(Unknown Source)
at java.io.BufferedOutputStream.flush(Unknown Source)
at com.sun.jndi.ldap.Connection.writeRequest(Unknown Source)
at com.sun.jndi.ldap.LdapClient.ldapBind(Unknown Source)
... 12 more
Caused by: java.io.EOFException: SSL peer shut down incorrectly
at com.sun.net.ssl.internal.ssl.InputRecord.read(Unknown Source)
... 20 more
你能帮助我吗??
谢谢!
发表评论
-
利用sax和xslt转换csv文件内容
2008-02-03 15:57 3234package jaxp; import java.io.B ... -
通过BOM探测文本文件编码类型
2008-01-24 15:19 2435从tomcat源码抄来的改的: private Object ... -
java mail 纯文本附件乱码的解决方案
2008-01-24 15:16 6229java mail在发送纯文本附件时,当附件内容的编码和jvm ... -
ntdsutil设置AD查询返回最大条目
2008-01-18 16:56 1782AD缺省的最大查询结果为1000个,如果超过1千个,则需要客户 ... -
struts2-layout
2007-11-09 18:17 51testvvvv -
Http基本明文验证
2007-06-13 12:55 1897base64解码使用了novell的实现 java 代码 ... -
如何启用活动目录SSL连接
2007-06-13 10:49 3473ad:http://www.cnblogs.com/chnki ... -
AD User重要属性
2007-06-11 14:55 2235objectClass=User User-Account ... -
ldap 访问AD测试
2007-06-08 16:37 4442java 代码 java 代码 /** ... -
JNDI 连接Windows Active Directory 教程(转)
2007-06-08 16:36 3309个人收藏,来源:http:// ... -
正确认识memcached的缓存失效
2007-05-29 10:56 9663最近javaeye上memcached相当火,不少人把它当作s ... -
webwork结合memcached实现sna架构
2007-05-28 14:04 5841实现思路,使用一个拦截器实现session的处理: ... -
activemq实验
2007-05-17 11:37 2179实验环境:activemq4.1.1/spring1.2.8 ... -
发现用Spring配置事务不爽的一个地方
2007-05-11 16:41 2078举个例子: SomeService implement I ... -
Java Transaction Design Strategies读书笔记
2007-05-14 15:34 2457第一种:Client Owner Transaction Ma ... -
有谁知道银行的跨行转帐是怎么保证交易的原子性和一致性?
2007-05-10 09:18 23302最近在看《Java Transaction Design St ... -
InnerClass引用的外层local final变量,究竟具有什么语义
2006-12-21 18:04 6696先看这段代码: public class ShowAnon ...
相关推荐
本文将深入探讨如何利用Java编程语言来实现AD域用户插入和密码修改操作。这些功能对于自动化IT运维流程至关重要,特别是对于大型企业或组织来说,能显著提高效率。 首先,Java通过JNDI(Java Naming and Directory ...
在本文中,我们将深入探讨如何使用Java JNDI来修改AD域密码,并重点讲解如何实现免SSL验证的方式。 首先,让我们了解JNDI。JNDI是Java平台的一个接口,它提供了一组API,允许开发者查找和绑定网络资源,如DNS记录、...
在传统的AD密码更改流程中,用户通常需要通过域控制器或登录到他们的Windows桌面来更改密码。而通过在SharePoint页面上集成这个Webpart,可以简化这一过程,提高用户体验。 这个Webpart的Demo是一个已经开发完成并...
AD批量添加用户 AD批量添加用户是活动目录技术中的一项重要操作。...使用dsadd命令和CMD中的for循环,我们可以轻松地批量添加用户到AD中,而使用dsquery命令和dsmod命令,我们可以批量修改某个OU下的所有用户的密码。
5. **配置AD策略**:为了允许用户通过网页修改密码,需要在AD中设置相应的密码策略,例如启用“用户必须在下次登录时更改密码”策略,并可能需要配置密码重置权限。 6. **测试和验证**:设置完成后,可以尝试使用一...
1. **修改AD密码**:大多数企业使用AD作为用户身份验证的中心,因此能够直接在SharePoint中更改AD密码极大地提高了效率。Web Part通过与AD进行安全通信,验证用户身份后,允许他们更新在AD中的密码,确保了数据的...
1. **修改AD域密码**:在AD环境中,用户密码的修改通常需要遵循特定的安全策略,例如最小长度、过期时间等。在Java LDAP中,这可以通过调用`DirContext.modifyAttributes()`方法实现。该方法接受DN(Distinguished ...
### Windows Server 2012 Web方式修改域用户密码 #### 概述 在企业环境中,经常需要对域用户进行管理,包括修改密码等操作。通常这些操作需要在域内的计算机上完成,但对于非域内计算机来说就显得较为不便。...
在SharePoint 2021环境中,系统默认不提供直接修改Active Directory (AD)域用户密码的功能,也不支持以其他用户身份登录。然而,通过自定义开发和利用Future的方式,可以实现这些功能。本文档主要介绍了如何实现这两...
Java 使用 LDAP 修改 AD 域用户密码 本文档主要介绍了如何使用 Java 通过 LDAP 协议修改 Active Directory(AD)域用户密码的详细步骤。下面将对标题、描述、标签和部分内容进行详细解释。 一、标题和描述 标题...
"AD用户成批添加器"就是为了解决这个问题而设计的工具,它通过VB(Visual Basic)编程语言实现,能够高效地自动化用户账户的创建过程。 VB是一种基于事件驱动的编程语言,它允许开发者通过简单的代码来创建图形用户...
AD 改本地管理员密码 Active Directory(AD)中批量改本地管理员密码是系统管理员经常面临的一个问题,本文将详细介绍如何通过组策略和脚本来实现批量改本地管理员密码的操作。 一、使用组策略批量改本地管理员...
总结,Windows Server 2008 R2的Web方式修改域用户密码功能通过集成IIS、AD和Web技术,为域用户提供了一种便捷的密码管理方式。配置和实施时需考虑安全性、易用性和策略一致性,以确保系统的稳定和高效运行。
具体功能:能够查看用户、获取用户、新建用户、解锁用户、重置用户密码、禁用或启用用户、删除用户、设置用户属性、查看组添加组、从组中删除用户。内置日志查看工具、锁定/最后登陆时间查看器、属性中英文对照表。
在默认情况下,VisualSVN Server的用户管理并不直接支持在线修改用户密码,但通过一些设置和配置,我们可以为用户提供这个便利的功能。 首先,我们需要了解VisualSVN Server的基本架构。它基于Apache HTTP Server,...
3. **修改AD密码**: - 使用`DirContext.modifyAttributes()`方法和`ModificationItem`来更新用户的密码。创建一个`ModificationItem`,其操作类型为`REPLACE`,属性为`unicodePwd`,值为新密码的Unicode编码。 4....
这可能涉及到监听AD的更改事件,或者定期运行一个任务来从AD拉取最新数据。使用Spring Boot的任务调度功能,例如`@Scheduled`注解,可以实现这个需求。 在提供的"demo"文件中,可能包含了实现上述功能的示例代码,...
当用户通过IISadmpwd修改密码时,请求会经过IIS服务器,验证用户的身份,然后更新AD数据库中的密码信息。 配置IISadmpwd的过程包括以下几个步骤: 1. 安装IISadmpwd:在Windows Server上安装IIS服务,并将...