尝试使用TLS连接到LDAP时出错“ LDAP结果代码201“ ErrorNetwork”:无效的数据包格式”

I'm trying make an authentication service with LDAP and TLS using http://www.github.com/mavricknz/ldap When I use only basic authentication using the following code, everything works just fine.

conn := ldap.NewLDAPConnection(ldapHost, ldapPort)

conn.NetworkConnectTimeout = time.Duration(ldapConnTimeout) * time.Millisecond
conn.ReadTimeout = time.Duration(ldapReadTimeout) * time.Millisecond

if err := conn.Connect(); err != nil {
    log.Println(err)
    resp.WriteHeader(http.StatusInternalServerError)
    return
}

defer conn.Close()

// bind to ldap
if err := conn.Bind(username, password); err != nil {
    ldaperr := err.(*ldap.LDAPError)
    if ldaperr.ResultCode == ldap.LDAPResultInvalidCredentials {
        resp.Header().Set("WWW-Authenticate", `Basic realm="Item Codes Database"`)
        resp.WriteHeader(http.StatusUnauthorized)
    } else {
        log.Println(err)
        resp.WriteHeader(http.StatusInternalServerError)
    }
    return
}

but when I try to applying TLS to my code by changing

conn := ldap.NewLDAPConnection(ldapHost, ldapPort)

to

ldap.NewLDAPTLSConnection(ldapHost, ldapPort, &tls.Config{})

It gives me an error LDAP Result Code 201 "ErrorNetwork": Invalid packet format. That error comes from method conn.Connect() which when I dig into it, it didn't even reach the point where the TLS config or TLS flag has been used.

drkenap147751
drkenap147751 我有完全相同的问题。下周,我将尝试使用go-ldap库,它是mavericknz的更新后的分支,并且具有相当新的FixStartTLS补丁,希望对您有所帮助。如果此举或其他举足轻重的成果,我一定会提交答案。如果找到解决方案,希望您也回答自己的问题。
5 年多之前 回复

1个回答



好,我找到了解决方案。 我需要将端口从ldap的389更改为ldaps的636,因为我们使用TLS协议。 而且我还必须使用方法 NewLDAPSSLConnection </ code>来建立隐式TLS连接。</ p>

我不确定为什么 NewLDAPTSLConnection </ code>不这样做 工作。 它使用显式TLS,这要求我们首先建立普通连接(使用端口389),然后尝试通过该连接启动TLS。</ p>
</ div>

展开原文

原文

Ok, I've found my solution. I need to change the port from ldap's 389 to ldaps' 636 because we use TLS protocol. And I also has to use method NewLDAPSSLConnection instead to establish an implicit TLS connection.

I'm not sure why NewLDAPTSLConnection does not work. It use explicit TLS which require us to establish a normal connection first (which use port 389) and then attempt to start TLS over that connection.

dsavz66262
dsavz66262 我不了解OP的LDAP服务器,但在许多支持TLS的LDAP服务器上也遇到了相同的问题,并且它们在与Perl建立连接时可以工作,但不能与Go库建立连接。 我认为这是Go lib中的错误。
5 年多之前 回复
doukun0888
doukun0888 这是一种解决方法,而不是适当的解决方案。 似乎NewLDAPTLSConnection()中存在错误。
5 年多之前 回复
dongmen5867
dongmen5867 LDAP服务器在端口389上是否支持STARTTLS? 显然不是。
5 年多之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
PHP LDAP验证证书 - ldap_start_tls():无法启动TLS

<div class="post-text" itemprop="text"> <p>I am trying to do LDAP authenticate with certificate in Ubuntu </p> <p>My PHP Code as follows : </p> <pre><code> $ldap="ldap://myhostname"; $usr="myemail@domain.com"; $pwd="mypwd"; $ds=ldap_connect($ldap); $ldapbind=false; if(ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) if(ldap_set_option($ds, LDAP_OPT_REFERRALS, 0)) if(ldap_start_tls($ds)) $ldapbind = @ldap_bind($ds, $usr, $pwd); ldap_close($ds); if(!$ldapbind) echo "ERROR"; else echo "OK"; </code></pre> <p>In my ldap.conf file I added the following lines: </p> <blockquote> <p>TLS_REQCERT never</p> <p>TLS_CACERT /home/Desktop/rootCA.crt</p> </blockquote> <p>But output as follows <strong>ldap_start_tls(): Unable to start TLS</strong></p> </div>

警告:ldap_start_tls()[function.ldap-start-tls]:无法启动TLS:服务器不可用

<div class="post-text" itemprop="text"> <blockquote> <p>Warning: ldap_start_tls() [function.ldap-start-tls]: Unable to start TLS: Server is unavailable in /var/www/html/testldap/index.php on line 13 Ldap_start_tls failed</p> </blockquote> <p>My configuration is as follows</p> <p>Centos 5.7 PHP Version 5.3.3</p> <p>php53-ldap configured. No matter what I try to do , the starttls issue is giving me a headache. Any help would be highly appreciated.</p> </div>

带有TLS的PHP用于安全LDAP

<div class="post-text" itemprop="text"> <p>I am trying to use remote LDAP server. For the purpose of security, I am trying to use only secure connection. I am able to get some code working but I am not sure, given the PHP documentation of start TLS itself, that if the following code works only on secure channel. Can anyone help with this please?</p> <pre><code>$is_valid_user = FALSE; try { $ds = ldap_connect('ldap.foo.com', 389); if (! ldap_set_option($ds, LDAP_OPT_REFERRALS, 0)) { return ""; } if (! ldap_start_tls($ds)) { return ""; } } catch(Exception $e) { return ""; } if (! ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3)) { $error = "LDAP Server protocol error."; return ""; } try { $bnd = @ldap_bind($ds, 'uid='.$user.', ou=people, dc=ldap, dc=foo, dc=com' , $passwd); if ($bnd) { $is_valid_user = TRUE; $srch=ldap_search($ds, 'dc=ldap, dc=foo, dc=com', "uid=$user"); $info=ldap_get_entries($ds, $srch); $userdn=$info[0]["dn"]; $usernm=$info[0]["cn"][0]; return $usernm; } else { return ""; } } catch(Exception $e) { return ""; } </code></pre> </div>

使用URL的PHP​​ LDAP连接

<div class="post-text" itemprop="text"> <p>I have a problem while trying to connect from an Ubuntu server with PHP5 to a LDAP server using URL('ldap://hostname/'). The code works fine when I'm not using the URL format (<code>$server = 'hostname'</code>).</p> <p>The code:</p> <pre><code>$server = 'ldap://hostname/'; $ldapconn = ldap_connect($server, 3268) or die("Could not connect to LDAP server."); if ($ldapconn) { $ldapbind = @ldap_bind($ldapconn, 'username', 'password'); $error_ldap_code = ldap_errno($ldapconn) ; if($error_ldap_code==0) { echo 'Connected!!!'; } } </code></pre> <p>Edit:</p> <p>I needed <code>ldaps</code>, but I saw that with <code>ldap</code> I have the same problem. While the problem related to ldap was solved by adding the port in the URL, I still had the ldaps issue. Anyway, I managed to bypass it by using <code>ldap_start_tls ( resource $link )</code> after connecting using only the hostname (without URL format).</p> </div>

LDAP连接在PHP 5上运行但不在PHP 7上运行

<div class="post-text" itemprop="text"> <p>I want to bind to LDAP server, but when I try to do that in PHP 7 it is not working. Same code however works in PHP 5.</p> <p>I have code:</p> <pre class="lang-php prettyprint-override"><code>$ldapconn = ldap_connect("ldaps://192.168.22.222:636") or die("Could not connect to LDAP server."); if ($ldapconn) { ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); $ldapbind = ldap_bind($ldapconn, 'username', 'password'); if ($ldapbind) { echo "LDAP bind successful..."; } else { echo "LDAP bind failed..."; } } </code></pre> <p>When I execute this code in PHP 5 I get:</p> <pre><code>LDAP bind successful... </code></pre> <p>And in LDAP server logs I can see this:</p> <pre><code>conn=434976 fd=26 ACCEPT from IP=8.8.8.8:43536 (IP=0.0.0.0:636) conn=434976 fd=26 TLS established tls_ssf=128 ssf=128 conn=434976 op=0 BIND dn="" method=128 conn=434976 op=0 RESULT tag=97 err=0 text= conn=434976 op=1 UNBIND conn=434976 fd=26 closed </code></pre> <p>In PHP 7 I get response:</p> <pre><code>Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server </code></pre> <p>and in LDAP logs:</p> <pre><code>conn=434975 fd=26 ACCEPT from IP=8.8.8.8:50919 (IP=0.0.0.0:636) conn=434975 fd=26 TLS established tls_ssf=256 ssf=256 conn=434975 fd=26 closed (connection lost) </code></pre> <p>I found some solutions with disabling cert validation on LDAP server, but I cannot change anything in config of that server.</p> <p>Can you help me how to bind in PHP 7? I tested that in PHP 7.2 and 7.3 with default config.</p> </div>

ldap_search()操作错误

<div class="post-text" itemprop="text"> <p>I've looked at a lot of other questions about this but can't seen to find the solution for my error.</p> <p>The code I use is:</p> <pre><code>ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); $ldapconn = ldap_connect('[HOST]', 389); ldap_set_option($ldapconn, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ldapconn, LDAP_OPT_REFERRALS, 0); ldap_bind($ldapconn, $username, $password); $authUser = $adldap-&gt;user()-&gt;authenticate($username, $password); if ($authUser == true) { echo "jep"; echo "&lt;br /&gt;"; $basedn = "DC=lab,DC=kuhlmann-its,DC=local"; $classname = "TAI2"; $filter = "(memberOf=OU=" . $classname . ",OU=Accounts,OU=BBS_Students,OU=BBS,OU=EDUNET,DC=lab,DC=kuhlmann-its,DC=local)"; $attributes = array("cn"); $search = ldap_search($ldapconn, $basedn, $filter, $attributes); $info = ldap_get_entries($ldapconn, $search); </code></pre> <p>This is my first time working with LDAP and Active Directory and I don't know how all the functions work. I want to know why my ldap_search() is not working.</p> <p>Thanks in advance.</p> </div>

使用gopkg.in/ldap.v2的LDAP身份验证错误:无法读取LDAP响应数据包:意外的EOF

<div class="post-text" itemprop="text"> <p>I am new to golang, i been trying to implement ldap authentication using gopkg.in/ldap.v2.</p> <p>below is the code i using . example from the document : <a href="https://godoc.org/gopkg.in/go-ldap/ldap.v2" rel="nofollow">https://godoc.org/gopkg.in/go-ldap/ldap.v2</a></p> <pre><code>// The username and password we want to check username := "someuser" password := "userpassword" bindusername := "readonly" bindpassword := "password" l, err := ldap.Dial("tcp", fmt.Sprintf("%s:%d", "ldap.example.com", 389)) if err != nil { log.Fatal(err) } defer l.Close() // Reconnect with TLS err = l.StartTLS(&amp;tls.Config{InsecureSkipVerify: true}) if err != nil { log.Fatal(err) } // First bind with a read only user err = l.Bind(bindusername, bindpassword) if err != nil { log.Fatal(err) } // Search for the given username searchRequest := ldap.NewSearchRequest( "dc=example,dc=com", ldap.ScopeWholeSubtree, ldap.NeverDerefAliases, 0, 0, false, fmt.Sprintf("(&amp;(objectClass=organizationalPerson)&amp;(uid=%s))", username), []string{"dn"}, nil, ) sr, err := l.Search(searchRequest) if err != nil { log.Fatal(err) } if len(sr.Entries) != 1 { log.Fatal("User does not exist or too many entries returned") } userdn := sr.Entries[0].DN // Bind as the user to verify their password err = l.Bind(userdn, password) if err != nil { log.Fatal(err) } // Rebind as the read only user for any futher queries err = l.Bind(bindusername, bindpassword) if err != nil { log.Fatal(err) } </code></pre> <p>here is the error i am getting at First Bind step: <strong>unable to read LDAP response packet: unexpected EOF</strong></p> <p>I am stuck here. can any one help me here . Thanks</p> </div>

与AD LDS的PHP LDAP连接

<div class="post-text" itemprop="text"> <p>I'm trying to write some PHP to query an AD LDS/LDAP (2012 R2) instance and I can't get the thing to connect. I currently have it set up as an unencrypted connection (prod will be ssl/tls).</p> <p>Current troubleshooting:</p> <ul> <li>I can connect to my LDAP instance via ldapsearch and perform queries</li> <li>I can connect via LDP on my windows boxes</li> <li>I can ping the LDAP server and telnet to the port from my nix box.</li> <li>Tried full rdn for the username</li> <li>Tried URI (ldap://ldapserver:50001 or passing the port as it's own var)</li> </ul> <p>I've rewritten the code a million times thinking it was a syntax error of some sort or something not passing correctly. $ldapconn is returning "Resource id #2", which per the PHP manual appears to be correct. I'm stumped at this point. Is there any additional debugging I can turn on?</p> <p>Here is the error it's kicking back:</p> <blockquote> <p>Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in /usr/share/nginx/html/logintest3.php on line 20</p> </blockquote> <p>Here is the relevant code:</p> <pre><code>&lt;?php // all the debugging ini_set('display_errors', 'On'); ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); $ldapuser = "ldapbind"; $ldappassword = "ldapbinder"; $ldapserver = "ldapserver"; $ldapport = 50001; // connect to ldap server $ldapconn = ldap_connect($ldapserver, $ldapport) or die("Could not connect to $ldapserver"); // check if ldap_connect returned a resource value if($ldapconn) echo "$ldapconn"; // attempting bind $ldapbind = ldap_bind($ldapconn, $ldapuser, $ldappassword); echo "Ldap connection debug: " . ldap_error($ldapconn) . " "; ?&gt; </code></pre> </div>

如何使用Go创建到Cloud SQL数据库的TLS连接?

<div class="post-text" itemprop="text"> <p>I'm trying to create a TLS connection to a Cloud SQL database but I'm getting the following error when trying to prepare a statement:</p> <pre><code>x509: cannot validate certificate for &lt;cloud sql instance ip&gt; because it doesn't contain any IP SANs </code></pre> <p>Here is my setup code:</p> <blockquote> <pre><code>rootCertPool := x509.NewCertPool() pem, err := ioutil.ReadFile("/path/server-ca.pem") if err != nil { log.Fatal(err) } if ok := rootCertPool.AppendCertsFromPEM(pem); !ok { log.Fatal("Failed to append PEM.") } clientCert := make([]tls.Certificate, 0, 1) certs, err := tls.LoadX509KeyPair("/path/client-cert.pem", "/path/client-key.pem") if err != nil { log.Fatal(err) } clientCert = append(clientCert, certs) mysql.RegisterTLSConfig("custom", &amp;tls.Config{ RootCAs: rootCertPool, Certificates: clientCert, }) db, err := sql.Open("mysql", "&lt;user&gt;:&lt;password&gt;@tcp(&lt;cloud sql ip&gt;:3306)/&lt;db_name&gt;?tls=custom") </code></pre> </blockquote> </div>

LDAP无法将用户添加到组

<div class="post-text" itemprop="text"> <p>I need add a user to the group.</p> <pre><code>package main import ( "fmt" "log" "crypto/tls" "gopkg.in/ldap.v2" ) func main() { bindusername := "user" bindpassword := "pass" l, err := ldap.Dial("tcp", fmt.Sprintf("%s:%d", "ldap.example.com", 389)) if err != nil { log.Fatal(err) } fmt.Println("Connect dial") defer l.Close() // Reconnect with TLS err = l.StartTLS(&amp;tls.Config{InsecureSkipVerify: true}) if err != nil { log.Fatal(err) } err = l.Bind(bindusername, bindpassword) if err != nil { log.Fatal(err) } fmt.Println("Connect bind") modify := ldap.NewModifyRequest("CN=test-group,OU=,DC=,DC=,DC=") modify.Add("member", []string{"CN=test-user,OU=,OU=,OU=,DC=,DC=,DC="}) err = l.Modify(modify) if err != nil { log.Fatal(err) } } </code></pre> <p>But i can an errors: 2018/10/29 10:33:00 LDAP Result Code 53 "Unwilling To Perform": 00002147: SvcErr: DSID-031A12D2, problem 5003 (WILL_NOT_PERFORM), data 0.</p> <p>If I change </p> <pre><code>modify.Add("member", []string{"CN=test-user,OU=,OU=,OU=,DC=,DC=,DC="}) </code></pre> <p>to </p> <pre><code>modify.Add("description", []string{"test"}) </code></pre> <p>, there is no error. Help, please.</p> </div>

TLS是否在整个wss连接中使用或仅在连接时使用?

<div class="post-text" itemprop="text"> <p>I plan to write an secure websocket server in golang. My question is:</p> <p>Is TLS used throughout the entire connection when using <code>wss://</code>, or is it just used when upgrade from http(s) to websocket protocol?</p> <p>The reason I ask is that as I understand the websocket protocol has nothing to do with http except that the connection is initiated via http(s).</p> <p>So, if I use <code>ListenAndServeTLS</code> in my Go program, can I ensure that the entire websocket conversation is secure?</p> </div>

Golang TLS服务器和客户端,避免重新连接时客户端上的高内存使用

<div class="post-text" itemprop="text"> <p>According to the examples <a href="https://gist.github.com/spikebike/2232102" rel="nofollow noreferrer">here</a> and here <a href="https://gist.github.com/denji/12b3a568f092ab951456" rel="nofollow noreferrer">here</a> I setup a server and a client that uses TLS with custom certificates. Analyzing the memory usage over times with pprof shows that the number of allocs increases each time the TLS client connects. Looking at the logs a lot of these entries do exist:</p> <pre><code> # 0x5827cb math/big.nat.make+0x93b /usr/local/go/src/math/big/nat.go:68 # 0x58267e math/big.nat.mul+0x7ee /usr/local/go/src/math/big/nat.go:428 # 0x5780b8 math/big.(*Int).Mul+0x118 /usr/local/go/src/math/big/int.go:168 # 0x72d57b crypto/elliptic.(*CurveParams).addJacobian+0xf5b /usr/local/go/src/crypto/elliptic/elliptic.go:145 # 0x72ebe2 crypto/elliptic.(*CurveParams).ScalarMult+0x1c2 /usr/local/go/src/crypto/elliptic/elliptic.go:260 # 0x7c5934 crypto/tls.(*nistParameters).SharedKey+0xd4 /usr/local/go/src/crypto/tls/key_schedule.go:171 # 0x7c3d09 crypto/tls.(*ecdheKeyAgreement).processServerKeyExchange+0x1d9 /usr/local/go/src/crypto/tls/key_agreement.go:266 # 0x7a43e1 crypto/tls.(*clientHandshakeState).doFullHandshake+0x471 /usr/local/go/src/crypto/tls/handshake_client.go:503 # 0x7a3b9a crypto/tls.(*clientHandshakeState).handshake+0x3fa /usr/local/go/src/crypto/tls/handshake_client.go:399 # 0x7a21ec crypto/tls.(*Conn).clientHandshake+0x2cc /usr/local/go/src/crypto/tls/handshake_client.go:208 # 0x7a07fe crypto/tls.(*Conn).Handshake+0xee /usr/local/go/src/crypto/tls/conn.go:1343 # 0x7ca570 crypto/tls.DialWithDialer+0x220 /usr/local/go/src/crypto/tls/tls.go:156 # 0x8f2578 crypto/tls.Dial+0x1a8 /usr/local/go/src/crypto/tls/tls.go:180 # 0x8f2518 main.(*TCPSSLClient).Open+0x148 /home/audinate/vcx/tcpSslClient.go:39 </code></pre> <p>And also these:</p> <pre><code># 0x58364a math/big.nat.make+0x2ca /usr/local/go/src/math/big/nat.go:68 # 0x583507 math/big.nat.sqr+0x187 /usr/local/go/src/math/big/nat.go:570 # 0x578015 math/big.(*Int).Mul+0x75 /usr/local/go/src/math/big/int.go:164 # 0x72e0e0 crypto/elliptic.(*CurveParams).doubleJacobian+0xe0 /usr/local/go/src/crypto/elliptic/elliptic.go:197 # 0x72eb7c crypto/elliptic.(*CurveParams).ScalarMult+0x15c /usr/local/go/src/crypto/elliptic/elliptic.go:258 # 0x7c5934 crypto/tls.(*nistParameters).SharedKey+0xd4 /usr/local/go/src/crypto/tls/key_schedule.go:171 # 0x7c3d09 crypto/tls.(*ecdheKeyAgreement).processServerKeyExchange+0x1d9 /usr/local/go/src/crypto/tls/key_agreement.go:266 # 0x7a43e1 crypto/tls.(*clientHandshakeState).doFullHandshake+0x471 /usr/local/go/src/crypto/tls/handshake_client.go:503 # 0x7a3b9a crypto/tls.(*clientHandshakeState).handshake+0x3fa /usr/local/go/src/crypto/tls/handshake_client.go:399 # 0x7a21ec crypto/tls.(*Conn).clientHandshake+0x2cc /usr/local/go/src/crypto/tls/handshake_client.go:208 # 0x7a07fe crypto/tls.(*Conn).Handshake+0xee /usr/local/go/src/crypto/tls/conn.go:1343 # 0x7ca570 crypto/tls.DialWithDialer+0x220 /usr/local/go/src/crypto/tls/tls.go:156 # 0x8f2578 crypto/tls.Dial+0x1a8 /usr/local/go/src/crypto/tls/tls.go:180 # 0x8f2518 main.(*TCPSSLClient).Open+0x148 /home/audinate/vcx/tcpSslClient.go:39 </code></pre> <p>Doing a <em>go tool pprof <a href="http://localhost:6060/debug/pprof/allocs" rel="nofollow noreferrer">http://localhost:6060/debug/pprof/allocs</a></em> and a <em>top</em> hows that it counts up highly.</p> <pre><code>Type: alloc_space Time: Jul 19, 2019 at 3:03pm (CEST) Entering interactive mode (type "help" for commands, "o" for options) (pprof) top Showing nodes accounting for 124.23MB, 96.13% of 129.23MB total Dropped 34 nodes (cum &lt;= 0.65MB) Showing top 10 nodes out of 78 flat flat% sum% cum cum% 110.03MB 85.14% 85.14% 110.03MB 85.14% math/big.nat.make 3.53MB 2.73% 87.87% 6.47MB 5.00% compress/flate.NewWriter 2MB 1.55% 89.41% 2MB 1.55% math/big.basicSqr 1.80MB 1.39% 90.81% 2.94MB 2.28% compress/flate.(*compressor).init 1.50MB 1.16% 91.97% 1.50MB 1.16% encoding/pem.removeWhitespace 1.50MB 1.16% 93.13% 61.51MB 47.60% crypto/elliptic.(*CurveParams).doubleJacobian 1.14MB 0.88% 94.01% 1.14MB 0.88% compress/flate.newDeflateFast 1MB 0.77% 94.79% 1MB 0.77% reflect.unsafe_NewArray 1MB 0.77% 95.56% 1MB 0.77% reflect.(*structType).Field 0.73MB 0.57% 96.13% 0.73MB 0.57% main.NewConmon (pprof) </code></pre> <p>My Code on the client side is fairly simple: (not showing the timers to reconnect..)</p> <pre><code> ....... config := &amp;tls.Config{Certificates: certificates, RootCAs: cas, SessionTicketsDisabled: true} conn, err := tls.Dial("tcp", addr, config) if err != nil { ... return } .... conn.Close() .... </code></pre> </div>

无法联系ldap_bind上的LDAP服务器($ con,$ rdn,$ pwd)

<div class="post-text" itemprop="text"> <p>for a while now i'm fiddling around with an LDAP connection to an Active Directory Server for authentication. I tried this the PHP native way and also using Zend Framework. Even though the <code>ldap_connect()</code> works fine, as soon as i bind something, the ldapConnection appears to break down. This is the script i've tried</p> <pre><code>error_reporting(E_ALL | E_STRICT); putenv('LDAPTLS_REQCERT=never'); $ldapcon = ldap_connect("FQSN", 636); ldap_set_option($ldapcon, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($ldapcon, LDAP_OPT_REFERRALS, 0); $anon = ldap_bind($ldapcon, "CN=WebTestuserAW,OU=Benutzer,OU=DOM,DC=dom,DC=de", "Sommer2012"); //also tried: //$anon = ldap_bind($ldapcon, 'WebTestuserAW@dom.de', 'Sommer2012'); echo ldap_error($ldapcon); </code></pre> <p>Using the above i get <strong>Can't contact LDAP server</strong>. Doing a <code>var_dump($ldapcon)</code> returns a resource link. When trying to connect using the Zend Framework approach, the error may have some more hints, since some additional connection parameters are given</p> <pre><code>2012-11-12T14:37:39+01:00 DEBUG (7): Ldap: 1: host=FQHN,port=636,bindRequiresDn=1,baseDn=OU=Benutzer,OU=DOM,DC=dom,DC=de,accountFilterFormat=(sAMAccountName=%s),useSsl=1,useStartTls=,accountDomainName=dom.de,username=CN=WebTestuserAW,password=***** 2012-11-12T14:37:39+01:00 DEBUG (7): Ldap: 2: /var/www/html/login/library/Zend/Ldap.php(850): 0x1: Failed to retrieve DN for account: stosic@dvv.de [0x51 (Can't contact LDAP server): ldaps://FGHN:636] 2012-11-12T14:37:39+01:00 DEBUG (7): Ldap: 3: #0 /var/www/html/login/library/Zend/Auth/Adapter/Ldap.php(316): Zend_Ldap-&gt;bind('username@dom.de', '*****') </code></pre> <p>I seriously just have no clue anymore. I've googled around, played a bit with LDAP-Protocol Versions, played around with the request certificate option, but simply nothing helps. The connection to the server works per se on <code>ldap_connect</code> but as soon as you bind something it doesn't work anymore. This remains true for anonymous binds, too.</p> <p>At office no one has any clue and neither do i. So if anyone has any suggestions on what i can still try, i'd be very greatful for that! Thanks in advance.</p> <p>Additional information:</p> <ul> <li>Server LDAP Config: <ul> <li>LDAP Support enabled</li> <li>RCS Version $Id: ldap.c 299434 2010-05-17 20:09:42Z pajoye $</li> <li>Total Links 0/unlimited</li> <li>API Version 3001</li> <li>Vendor Name OpenLDAP</li> <li>Vendor Version 20343</li> <li>SASL Support Enabled</li> </ul></li> <li>Both ldap:// and ldaps:// has been tested</li> <li>ldap_connect() returns a resource link</li> <li>ldap_bind() doesn't work, ldap_errno() returns -1 (Can't connect to LDAP Server)</li> <li>LDAPTLS_REQCERT and TLS_REQCERT</li> </ul> </div>

如何在Go中缓存/重用TLS连接

<div class="post-text" itemprop="text"> <p>I've run into a problem where I create a new connection each request and it is terribly inefficient.</p> <p>I would like to allow a set maximum number of TLS connections to stay open/cached on my client at once. When data is ready to be transmitted it first checks if there is an idle connection, then it checks if it can create a new connection (i.e. number of open connections &lt; maximum allowed). If both are false then it has to wait until either a connection becomes idle or the number of open connections decreases. Connections should also be killed after they have been idle for a set amount of time.</p> <p>Here is some (bad) pseudocode of what I have in mind. Could I have some suggestions?</p> <pre><code>func newTLSConnection(netDialer, host, tlsConfig) (tls.Con) { // Set up the certs // ... // Make A TLS Connection con, _ := tls.DialWithDialer(netDialer, "tcp", host, tlsConfig) return con } func (con tls.Con) Do (someData []byte) { // If con // Send some date to the server _, _ := con.Write(someData) // Get response from server response := make([]byte, 100) _, _ := io.ReadFull(con, response) return } main(){ var cons []tls.Con maxConSize := 3 while { if allConsInSliceAreBusy() &amp;&amp; len(cons) &lt; maxConSize{ newCon = NewTLSConnection(...) cons = append(cons, newCon) conToUse := newCon conToUse.Do([]byte("stuff")) } else if !allConsInSliceAreBusy() { conToUse := firstOpenConInCons() conToUse.Do([]byte("stuff")) } else{ // NOP. Max cons created and they are all busy. // Wait for one to become idle or close. } } } </code></pre> <p>Thank you!</p> </div>

RabbitMQ-Tls连接-Golang

<div class="post-text" itemprop="text"> <p>I configured RabbitMQ connection using follow link: <a href="https://github.com/streadway/amqp/blob/master/examples_test.go" rel="nofollow noreferrer">https://github.com/streadway/amqp/blob/master/examples_test.go</a></p> <p>Certificate I created according to the instructions here: <a href="https://www.rabbitmq.com/ssl.html#enabling-tls-paths" rel="nofollow noreferrer">https://www.rabbitmq.com/ssl.html#enabling-tls-paths</a></p> <p>I use RabbitMQ 3.7.0 installed in docker. After the call amqp.DialTLS I receive "Bad certificate" error on the server side (in the docker logs).</p> <p>I suppose that the problem is that certificate should contain the server name and if so, which server name should I set in the certificate if RabbitMQ is installed inside docker?</p> <p>Besides, any other ideas?</p> </div>

使用PHP安全绑定到Active Directory的问题

<div class="post-text" itemprop="text"> <p>I seem to be unable to use php to securely bind to Active Directory. Unencrypted connections work fine. Using other clients are able to securely bind, e.g. connecting using LDAPAdmin over SSL. What is the problem here? Is there some LDAP SSL module that I'm missing? How to securely bind to the server using php? </p> <p>I noticed from <code>phpinfo()</code> that cURL has support for ldap/ldaps - what is a good example on utilizing this to perform secure bind in php? Is this a viable workaround?</p> <p>phpinfo();</p> <pre><code>ldap LDAP Support enabled RCS Version $Id: ldap.c 293036 2010-01-03 09:23:27Z sebastian $ Total Links 0/unlimited API Version 3001 Vendor Name OpenLDAP Vendor Version 20421 SASL Support Enabled </code></pre> <p>Attempting to bind to an Active Directory server using PHP Version 5.3.2-1ubuntu4.7 from Ubuntu 10.04 repo</p> <pre><code>$username = 'user'; $password = 'passwd'; $account_suffix = '@example.com'; $hostnameSSL = 'ldaps://ldap.example.com:636'; $hostnameTLS = 'ldap.example.com'; $portTLS = 389; ldap_set_option(NULL, LDAP_OPT_DEBUG_LEVEL, 7); // Attempting fix from http://www.php.net/manual/en/ref.ldap.php#77553 putenv('LDAPTLS_REQCERT=never'); #################### # SSL bind attempt # #################### // Attempting syntax from http://www.php.net/manual/en/function.ldap-bind.php#101445 $con = ldap_connect($hostnameSSL); if (!is_resource($con)) trigger_error("Unable to connect to $hostnameSSL",E_USER_WARNING); // Options from http://www.php.net/manual/en/ref.ldap.php#73191 if (!ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3)) { trigger_error("Failed to set LDAP Protocol version to 3, TLS not supported",E_USER_WARNING); } ldap_set_option($con, LDAP_OPT_REFERRALS, 0); if (ldap_bind($con,$username . $account_suffix, $password)) die('All went well using SSL'); ldap_close($con); #################### # TLS bind attempt # #################### $con = ldap_connect($hostnameTLS,$portTLS); ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($con, LDAP_OPT_REFERRALS, 0); $encrypted = (ldap_start_tls($con)); if ($encrypted) ldap_bind($con,$username . $account_suffix, $password); // Unecrypted works, but don't want logins sent in cleartext ldap_close($con); ##################### # SASL bind attempt # ##################### $con = ldap_connect($hostnameTLS,$portTLS); ldap_set_option($con, LDAP_OPT_PROTOCOL_VERSION, 3); ldap_set_option($con, LDAP_OPT_REFERRALS, 0); ldap_sasl_bind($con, NULL, $password, 'DIGEST-MD5', NULL, $username. $account_suffix); ldap_close($con); </code></pre> <p>All of the above fails. Errors from log:</p> <pre><code>ldap_create ldap_url_parse_ext(ldaps://ldap.example.com:636) ldap_bind_s ldap_simple_bind_s ldap_sasl_bind_s ldap_sasl_bind ldap_send_initial_request ldap_new_connection 1 1 0 ldap_int_open_connection ldap_connect_to_host: TCP ldap.example.com:636 ldap_new_socket: 27 ldap_prepare_socket: 27 ldap_connect_to_host: Trying 1.1.1.1:636 ldap_pvt_connect: fd: 27 tm: -1 async: 0 ldap_open_defconn: successful ldap_send_server_request ldap_result ld 0x215380c0 msgid 1 wait4msg ld 0x215380c0 msgid 1 (infinite timeout) wait4msg continue ld 0x215380c0 msgid 1 all 1 ** ld 0x215380c0 Connections: * host: ldap.example.com port: 636 (default) refcnt: 2 status: Connected last used: Thu Mar 10 11:15:53 2011 ** ld 0x215380c0 Outstanding Requests: * msgid 1, origid 1, status InProgress outstanding referrals 0, parent count 0 ld 0x215380c0 request count 1 (abandoned 0) ** ld 0x215380c0 Response Queue: Empty ld 0x215380c0 response count 0 ldap_chkResponseList ld 0x215380c0 msgid 1 all 1 ldap_chkResponseList returns ld 0x215380c0 NULL ldap_int_select read1msg: ld 0x215380c0 msgid 1 all 1 ldap_err2string [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP Warning: ldap_bind() [&lt;a href='function.ldap-bind'&gt;function.ldap-bind&lt;/a&gt;]: Unable to bind to server: Can't contact LDAP server in /..test.php on line 28 [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP Stack trace: [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP 1. {main}() /..test.php:0 [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP 2. ldap_bind() /..test.php:28 ldap_free_request (origid 1, msgid 1) ldap_free_connection 1 1 ldap_free_connection: actually freed ldap_create ldap_err2string [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP Warning: ldap_start_tls() [&lt;a href='function.ldap-start-tls'&gt;function.ldap-start-tls&lt;/a&gt;]: Unable to start TLS: Not Supported in /..test.php on line 37 [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP Stack trace: [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP 1. {main}() /..test.php:0 [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP 2. ldap_start_tls() /..test.php:37 ldap_create ldap_sasl_interactive_bind_s: user selected: DIGEST-MD5 ldap_err2string [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP Warning: ldap_sasl_bind() [&lt;a href='function.ldap-sasl-bind'&gt;function.ldap-sasl-bind&lt;/a&gt;]: Unable to bind to server: Not Supported in /..test.php on line 47 [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP Stack trace: [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP 1. {main}() /..test.php:0 [Thu Mar 10 11:15:53 2011] [error] [client ::1] PHP 2. ldap_sasl_bind() /..test.php:47 </code></pre> <p>Looking at ssl response:</p> <pre><code>&gt;&gt; openssl s_client -connect my.example.com:636 -prexit (...) SSL handshake has read 5732 bytes and written 443 bytes --- New, TLSv1/SSLv3, Cipher is RC4-MD5 Server public key is 2048 bit Secure Renegotiation IS supported Compression: NONE Expansion: NONE SSL-Session: Protocol : TLSv1 Cipher : RC4-MD5 Session-ID: 111111111111111111111111 Session-ID-ctx: Master-Key: AAAAAAAAAAAAAAAAAAAAA Key-Arg : None Start Time: 1299071105 Timeout : 300 (sec) Verify return code: 20 (unable to get local issuer certificate) </code></pre> <p>Results from 'strace php test.php' :</p> <pre><code> write(2, " refcnt: 2 status: Connected ", 31 refcnt: 2 status: Connected ) = 31 write(2, " last used: Tue Mar 15 10:59:19"..., 39 last used: Tue Mar 15 10:59:19 2011 ) = 39 write(2, " ", 1 ) = 1 write(2, "** ld 0x954e0b8 Outstanding Requ"..., 38** ld 0x954e0b8 Outstanding Requests: ) = 38 write(2, " * msgid 1, origid 1, status In"..., 41 * msgid 1, origid 1, status InProgress ) = 41 write(2, " outstanding referrals 0, pare"..., 43 outstanding referrals 0, parent count 0 ) = 43 write(2, " ld 0x954e0b8 request count 1 ("..., 45 ld 0x954e0b8 request count 1 (abandoned 0) ) = 45 write(2, "** ld 0x954e0b8 Response Queue: ", 32** ld 0x954e0b8 Response Queue: ) = 32 write(2, " Empty ", 9 Empty ) = 9 write(2, " ld 0x954e0b8 response count 0 ", 32 ld 0x954e0b8 response count 0 ) = 32 write(2, "ldap_chkResponseList ld 0x954e0b"..., 48ldap_chkResponseList ld 0x954e0b8 msgid 1 all 1 ) = 48 write(2, "ldap_chkResponseList returns ld "..., 47ldap_chkResponseList returns ld 0x954e0b8 NULL ) = 47 write(2, "ldap_int_select ", 16ldap_int_select ) = 16 poll([{fd=3, events=POLLIN|POLLPRI|POLLERR|POLLHUP}], 1, -1) = 1 ([{fd=3, revents=POLLIN}]) write(2, "read1msg: ld 0x954e0b8 msgid 1 a"..., 37read1msg: ld 0x954e0b8 msgid 1 all 1 ) = 37 read(3, "", 8) = 0 write(2, "ldap_err2string ", 16ldap_err2string ) = 16 write(2, "PHP Warning: ldap_bind(): Unabl"..., 158PHP Warning: ldap_bind(): Unable to bind to server: Can't contact LDAP server in </code></pre> <p>And I do have the /etc/ldap.conf fix with 'TLS_REQCERT never' - even though this fix is for a different error, which gives a fairly clear error message.</p> </div>

adldap2 laravel它只返回'false'

<div class="post-text" itemprop="text"> <p>I'm trying to use the <a href="https://github.com/Adldap2/Adldap2-Laravel" rel="nofollow noreferrer">adldap2</a> to access an <a href="https://www.forumsys.com/tutorials/integration-how-to/ldap/online-ldap-test-server/" rel="nofollow noreferrer">adldap server</a>.</p> <p>it's everything ok with the server, i have used the Apache Directory Studio to test it.</p> <p><a href="https://adldap2.github.io/Adldap2-Laravel/#/?id=quick-start" rel="nofollow noreferrer">I have followed all these instructions</a> but withou success. All of my requests are returning 'false' or a empty collection. </p> <p>what am i doing wrong?</p> <p>Here are my files:</p> <pre><code># \config\ldap.php return [ 'logging' =&gt; env('LDAP_LOGGING', false), 'connections' =&gt; [ 'default' =&gt; [ 'auto_connect' =&gt; env('LDAP_AUTO_CONNECT', true), 'connection' =&gt; Adldap\Connections\Ldap::class, 'settings' =&gt; [ 'schema' =&gt; Adldap\Schemas\ActiveDirectory::class, 'account_prefix' =&gt; env('LDAP_ACCOUNT_PREFIX', ''), 'account_suffix' =&gt; env('LDAP_ACCOUNT_SUFFIX', ''), 'hosts' =&gt; explode(' ', env('LDAP_HOSTS', 'ldap.forumsys.com')), 'port' =&gt; env('LDAP_PORT', 389), 'timeout' =&gt; env('LDAP_TIMEOUT', 5), 'base_dn' =&gt; env('LDAP_BASE_DN', 'dc=example,dc=com'), 'username' =&gt; env(' cn=read-only-admin,dc=example,dc=com'), 'password' =&gt; env('password'), 'follow_referrals' =&gt; false, 'use_ssl' =&gt; env('LDAP_USE_SSL', false), 'use_tls' =&gt; env('LDAP_USE_TLS', false), ], ], ], ]; </code></pre> <p>To test I using the web.php directly:</p> <pre><code>&lt;?php use Adldap\Laravel\Facades\Adldap; Route::get('/api', function(){ $user = Adldap::search()-&gt;users()-&gt;find('newton'); dd($user); return 'test page'; }); </code></pre> <p>Here is my response error</p> <p><a href="https://i.stack.imgur.com/U7KI3.png" rel="nofollow noreferrer">false response result</a></p> </div>

使用过Self service password来修改LDAP用户修改密码

因为现在统一用LDAP 做身份统一认证管理,所以现在想做到每个用户能自己自行的修改密码, 在baidu,google很多,可是解决这个根本的原因我查了又查,可是还是有点小问题。 问题贴出来了,求解决啊。 安装的步骤: @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ 安装 Self service password @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Note: http://ltb-project.org/wiki/download self service password download page CentOS下php安装mcrypt扩展: vim /etc/yum.repos.d/CentOS-Base.repo add line: [php-mcrypt] baseurl=http://mirrors.sohu.com/fedora-epel/6/x86_64/ enabled=1 gpgcheck=0 yum clean all 1、确认你的linux没有安装mcrypt库,如果已安装,跳过安装步骤 yum list installed|grep mcrypt yum install libmcrypt libmcrypt-devel mcrypt mhash (2)、安装php的mcrypt扩展(动态加载编译) 执行phpize命令(phpize是用来扩展php扩展模块的,通过phpize可以建立php的外挂模块,如果没有?yum install php-devel里包含了,或者其他方法) whereis phpize whereis php-config yum install php-mcrypt yum install php-devel 顺便检查下/usr/lib64/php/modules/里的mrcypt.so扩展是否已经创建成功 然后的事就简单了,给你的php.ini添加一条extension=mcrypt.so find / -type f -name '*mcrypt.so*' /usr/lib64/php/modules/mcrypt.so [root@company-backup01 ~]# ls -lh /usr/lib64/php/modules/mcrypt.so -rwxr-xr-x. 1 root root 46K 11月 26 2013 /usr/lib64/php/modules/mcrypt.so vim /etc/php.ini add line: extension=mcrypt.so whereis phpize whereis php-config php -m 进行检测扩展是否安装成功 (3) 、重启apache,查阅phpinfo,mcrypt模块扩展是不是加载了? service httpd restart vim /var/www/html/index.php <?php phpinfo(); ?> wget http://tools.ltb-project.org/att ... password-0.8.tar.gz cp ltb-project-self-service-password-0.8.tar.gz /var/www/html/ cd /var/www/html/ tar zxvf ltb-project-self-service-password-0.8.tar.gz mv ltb-project-self-service-password-0.8 ldap vim /var/www/html/ldap/conf/config.inc.php $ldap_url = "ldap://127.0.0.1:389"; $ldap_binddn = "cn=root,dc=test,dc=com"; $ldap_bindpw = "123456"; $ldap_base = "dc=test,dc=com"; $ldap_filter = "(&(objectClass=account)(uid={login}))"; $ad_mode = false; $samba_mode = true; $who_change_password = "manager"; // 之前是该项填写错误了! 这里我写admin 我从其他文档按这个步骤来的,可是还是出现了问题。 问题如下: ![图片说明](https://img-ask.csdn.net/upload/201512/16/1450235794_123896.jpg) 我的web修改页面说我LDAP认证过去修改密码拒绝。 我查看日志报错这个 属性问题 可是我查看了代码没有问题 代码贴出来了。 ![图片说明](https://img-ask.csdn.net/upload/201512/16/1450235840_584486.jpg) 麻烦帮忙解决下。 还有我从新搭建了LDAP认证,也出现了数据库拒绝写入。

连接失败后获取TLS证书链

<div class="post-text" itemprop="text"> <p>我有一个Go程序,它使用tls.server接受来自客户端的TLS连接。当连接特定客户端时,会得到错误"tls: failed to verify client's certificate: x509: certificate signed by unknown authority".</p> <p>我希望看到提供的证书链(验证失败),这样我就可以知道客户端做错了什么。有办法用Go的TLS软件包来实现吗?显而易见的答案——使用ConnectionState方法对我来说行不通,因为只有在握手成功之后才会填充ConnectionState的PeerCertifics字段。</p> </div>

Java基础知识面试题(2020最新版)

文章目录Java概述何为编程什么是Javajdk1.5之后的三大版本JVM、JRE和JDK的关系什么是跨平台性?原理是什么Java语言有哪些特点什么是字节码?采用字节码的最大好处是什么什么是Java程序的主类?应用程序和小程序的主类有何不同?Java应用程序与小程序之间有那些差别?Java和C++的区别Oracle JDK 和 OpenJDK 的对比基础语法数据类型Java有哪些数据类型switc...

软件测试入门、SQL、性能测试、测试管理工具

软件测试2小时入门,让您快速了解软件测试基本知识,有系统的了解; SQL一小时,让您快速理解和掌握SQL基本语法 jmeter性能测试 ,让您快速了解主流来源性能测试工具jmeter 测试管理工具-禅道,让您快速学会禅道的使用,学会测试项目、用例、缺陷的管理、

基于西门子S7—1200的单部六层电梯设计程序,1部6层电梯

基于西门子S7—1200的单部六层电梯设计程序,1部6层电梯。 本系统控制六层电梯, 采用集选控制方式。 为了完成设定的控制任务, 主要根据电梯输入/输出点数确定PLC 的机型。 根据电梯控制的要求,

捷联惯导仿真matlab

捷联惯导的仿真(包括轨迹仿真,惯性器件模拟输出,捷联解算),标了详细的注释捷联惯导的仿真(包括轨迹仿真,惯性器件模拟输出,捷联解算),标了详细的注释

深度学习原理+项目实战+算法详解+主流框架(套餐)

深度学习系列课程从深度学习基础知识点开始讲解一步步进入神经网络的世界再到卷积和递归神经网络,详解各大经典网络架构。实战部分选择当下最火爆深度学习框架PyTorch与Tensorflow/Keras,全程实战演示框架核心使用与建模方法。项目实战部分选择计算机视觉与自然语言处理领域经典项目,从零开始详解算法原理,debug模式逐行代码解读。适合准备就业和转行的同学们加入学习! 建议按照下列课程顺序来进行学习 (1)掌握深度学习必备经典网络架构 (2)深度框架实战方法 (3)计算机视觉与自然语言处理项目实战。(按照课程排列顺序即可)

图书管理系统(Java + Mysql)我的第一个完全自己做的实训项目

图书管理系统 Java + MySQL 完整实训代码,MVC三层架构组织,包含所有用到的图片资源以及数据库文件,大三上学期实训,注释很详细,按照阿里巴巴Java编程规范编写

玩转Linux:常用命令实例指南

人工智能、物联网、大数据时代,Linux正有着一统天下的趋势,几乎每个程序员岗位,都要求掌握Linux。本课程零基础也能轻松入门。 本课程以简洁易懂的语言手把手教你系统掌握日常所需的Linux知识,每个知识点都会配合案例实战让你融汇贯通。课程通俗易懂,简洁流畅,适合0基础以及对Linux掌握不熟练的人学习; 【限时福利】 1)购课后按提示添加小助手,进答疑群,还可获得价值300元的编程大礼包! 2)本月购买此套餐加入老师答疑交流群,可参加老师的免费分享活动,学习最新技术项目经验。 --------------------------------------------------------------- 29元=掌握Linux必修知识+社群答疑+讲师社群分享会+700元编程礼包。 &nbsp;

网络工程师小白入门--【思科CCNA、华为HCNA等网络工程师认证】

本课程适合CCNA或HCNA网络小白同志,高手请绕道,可以直接学习进价课程。通过本预科课程的学习,为学习网络工程师、思科CCNA、华为HCNA这些认证打下坚实的基础! 重要!思科认证2020年2月24日起,已启用新版认证和考试,包括题库都会更新,由于疫情原因,请关注官网和本地考点信息。题库网络上很容易下载到。

C++语言基础视频教程

C++语言基础视频培训课程:本课与主讲者在大学开出的程序设计课程直接对接,准确把握知识点,注重教学视频与实践体系的结合,帮助初学者有效学习。本教程详细介绍C++语言中的封装、数据隐藏、继承、多态的实现等入门知识;主要包括类的声明、对象定义、构造函数和析构函数、运算符重载、继承和派生、多态性实现等。 课程需要有C语言程序设计的基础(可以利用本人开出的《C语言与程序设计》系列课学习)。学习者能够通过实践的方式,学会利用C++语言解决问题,具备进一步学习利用C++开发应用程序的基础。

微信小程序 实例汇总 完整项目源代码

微信小程序 实例汇总 完整项目源代码

Python数据挖掘简易入门

&nbsp; &nbsp; &nbsp; &nbsp; 本课程为Python数据挖掘方向的入门课程,课程主要以真实数据为基础,详细介绍数据挖掘入门的流程和使用Python实现pandas与numpy在数据挖掘方向的运用,并深入学习如何运用scikit-learn调用常用的数据挖掘算法解决数据挖掘问题,为进一步深入学习数据挖掘打下扎实的基础。

2020-五一数学建模大赛C类问题饲料加工配比及优化.pdf

2020年,“51”数学建模C类问题,关于饲料配比问题以及加工优化方案。论文采用统计分析,建立了关于饲料加工的多目标优化模型。并利用蒙特卡罗算法对目标函数进行优化,解决了饲料加工质量最优配比问题并进行

MySQL数据库从入门到实战应用

限时福利1:购课进答疑群专享柳峰(刘运强)老师答疑服务 限时福利2:购课后添加学习助手(微信号:csdn590),按消息提示即可领取编程大礼包! 为什么说每一个程序员都应该学习MySQL? 根据《2019-2020年中国开发者调查报告》显示,超83%的开发者都在使用MySQL数据库。 使用量大同时,掌握MySQL早已是运维、DBA的必备技能,甚至部分IT开发岗位也要求对数据库使用和原理有深入的了解和掌握。 学习编程,你可能会犹豫选择 C++ 还是 Java;入门数据科学,你可能会纠结于选择 Python 还是 R;但无论如何, MySQL 都是 IT 从业人员不可或缺的技能! 【课程设计】 在本课程中,刘运强老师会结合自己十多年来对MySQL的心得体会,通过课程给你分享一条高效的MySQL入门捷径,让学员少走弯路,彻底搞懂MySQL。 本课程包含3大模块:&nbsp; 一、基础篇: 主要以最新的MySQL8.0安装为例帮助学员解决安装与配置MySQL的问题,并对MySQL8.0的新特性做一定介绍,为后续的课程展开做好环境部署。 二、SQL语言篇: 本篇主要讲解SQL语言的四大部分数据查询语言DQL,数据操纵语言DML,数据定义语言DDL,数据控制语言DCL,学会熟练对库表进行增删改查等必备技能。 三、MySQL进阶篇: 本篇可以帮助学员更加高效的管理线上的MySQL数据库;具备MySQL的日常运维能力,语句调优、备份恢复等思路。 &nbsp;

navicat简体中文版 绿色版 (64位)

解压后安装navicat,打开navicat执行PatchNavicat即破解成功。可以正常使用啦。

linux“开发工具三剑客”速成攻略

工欲善其事,必先利其器。Vim+Git+Makefile是Linux环境下嵌入式开发常用的工具。本专题主要面向初次接触Linux的新手,熟练掌握工作中常用的工具,在以后的学习和工作中提高效率。

机器学习初学者必会的案例精讲

通过六个实际的编码项目,带领同学入门人工智能。这些项目涉及机器学习(回归,分类,聚类),深度学习(神经网络),底层数学算法,Weka数据挖掘,利用Git开源项目实战等。

Python代码实现飞机大战

文章目录经典飞机大战一.游戏设定二.我方飞机三.敌方飞机四.发射子弹五.发放补给包六.主模块 经典飞机大战 源代码以及素材资料(图片,音频)可从下面的github中下载: 飞机大战源代码以及素材资料github项目地址链接 ————————————————————————————————————————————————————————— 不知道大家有没有打过飞机,喜不喜欢打飞机。当我第一次接触这个东西的时候,我的内心是被震撼到的。第一次接触打飞机的时候作者本人是身心愉悦的,因为周边的朋友都在打飞机, 每

java jdk 8 帮助文档 中文 文档 chm 谷歌翻译

JDK1.8 API 中文谷歌翻译版 java帮助文档 JDK API java 帮助文档 谷歌翻译 JDK1.8 API 中文 谷歌翻译版 java帮助文档 Java最新帮助文档 本帮助文档是使用谷

Qt5.10 GUI完全参考手册(强烈推荐)

本书是Qt中文版的参考手册,内容详尽易懂,详细介绍了Qt实现的各种内部原理,是一本不可多得的参考文献

Python可以这样学(第四季:数据分析与科学计算可视化)

董付国老师系列教材《Python程序设计(第2版)》(ISBN:9787302436515)、《Python可以这样学》(ISBN:9787302456469)配套视频,在教材基础上又增加了大量内容,通过实例讲解numpy、scipy、pandas、statistics、matplotlib等标准库和扩展库用法。

设计模式(JAVA语言实现)--20种设计模式附带源码

课程亮点: 课程培训详细的笔记以及实例代码,让学员开始掌握设计模式知识点 课程内容: 工厂模式、桥接模式、组合模式、装饰器模式、外观模式、享元模式、原型模型、代理模式、单例模式、适配器模式 策略模式、模板方法模式、观察者模式、迭代器模式、责任链模式、命令模式、备忘录模式、状态模式、访问者模式 课程特色: 笔记设计模式,用笔记串连所有知识点,让学员从一点一滴积累,学习过程无压力 笔记标题采用关键字标识法,帮助学员更加容易记住知识点 笔记以超链接形式让知识点关联起来,形式知识体系 采用先概念后实例再应用方式,知识点深入浅出 提供授课内容笔记作为课后复习以及工作备查工具 部分图表(电脑PC端查看):

进程监控软件 Performance Monitor中文版

告诉你每个程序现在在做什么,还可以根据你的要求过滤无关的内容。

八数码的深度优先算法c++实现

人工智能的八数码的深度优先算法c++实现

2021考研数学张宇基础30讲.pdf

张宇:博士,全国著名考研数学辅导专家,教育部“国家精品课程建设骨干教师”,全国畅销书《张宇高等数学18讲》《张宇线性代数9讲》《张宇概率论与数理统计9讲》《张宇考研数学题源探析经典1000题》《张宇考

2019 Python开发者日-培训

本次活动将秉承“只讲技术,拒绝空谈”的理念,邀请十余位身处一线的Python技术专家,重点围绕Web开发、自动化运维、数据分析、人工智能等技术模块,分享真实生产环境中使用Python应对IT挑战的真知灼见。此外,针对不同层次的开发者,大会还安排了深度培训实操环节,为开发者们带来更多深度实战的机会。

C/C++跨平台研发从基础到高阶实战系列套餐

一 专题从基础的C语言核心到c++ 和stl完成基础强化; 二 再到数据结构,设计模式完成专业计算机技能强化; 三 通过跨平台网络编程,linux编程,qt界面编程,mfc编程,windows编程,c++与lua联合编程来完成应用强化 四 最后通过基于ffmpeg的音视频播放器,直播推流,屏幕录像,

2020_五一数学建模_C题_整理后的数据.zip

该数据是我的程序读取的数据,仅供参考,问题的解决方案:https://blog.csdn.net/qq_41228463/article/details/105993051

机器学习实战系列套餐(必备基础+经典算法+案例实战)

机器学习实战系列套餐以实战为出发点,帮助同学们快速掌握机器学习领域必备经典算法原理并结合Python工具包进行实战应用。建议学习顺序:1.Python必备工具包:掌握实战工具 2.机器学习算法与实战应用:数学原理与应用方法都是必备技能 3.数据挖掘实战:通过真实数据集进行项目实战。按照下列课程顺序学习即可! 课程风格通俗易懂,用最接地气的方式带领大家轻松进军机器学习!提供所有课程代码,PPT与实战数据,有任何问题欢迎随时与我讨论。

实用主义学Python(小白也容易上手的Python实用案例)

原价169,限时立减100元! 系统掌握Python核心语法16点,轻松应对工作中80%以上的Python使用场景! 69元=72讲+源码+社群答疑+讲师社群分享会&nbsp; 【哪些人适合学习这门课程?】 1)大学生,平时只学习了Python理论,并未接触Python实战问题; 2)对Python实用技能掌握薄弱的人,自动化、爬虫、数据分析能让你快速提高工作效率; 3)想学习新技术,如:人工智能、机器学习、深度学习等,这门课程是你的必修课程; 4)想修炼更好的编程内功,优秀的工程师肯定不能只会一门语言,Python语言功能强大、使用高效、简单易学。 【超实用技能】 从零开始 自动生成工作周报 职场升级 豆瓣电影数据爬取 实用案例 奥运冠军数据分析 自动化办公:通过Python自动化分析Excel数据并自动操作Word文档,最终获得一份基于Excel表格的数据分析报告。 豆瓣电影爬虫:通过Python自动爬取豆瓣电影信息并将电影图片保存到本地。 奥运会数据分析实战 简介:通过Python分析120年间奥运会的数据,从不同角度入手分析,从而得出一些有趣的结论。 【超人气老师】 二两 中国人工智能协会高级会员 生成对抗神经网络研究者 《深入浅出生成对抗网络:原理剖析与TensorFlow实现》一书作者 阿里云大学云学院导师 前大型游戏公司后端工程师 【超丰富实用案例】 0)图片背景去除案例 1)自动生成工作周报案例 2)豆瓣电影数据爬取案例 3)奥运会数据分析案例 4)自动处理邮件案例 5)github信息爬取/更新提醒案例 6)B站百大UP信息爬取与分析案例 7)构建自己的论文网站案例

相关热词 c#设计思想 c#正则表达式 转换 c#form复制 c#写web c# 柱形图 c# wcf 服务库 c#应用程序管理器 c#数组如何赋值给数组 c#序列化应用目的博客园 c# 设置当前标注样式
立即提问