朝頭早比CTO 睇完d code, 話我唔應該經shell script pass password入去JVM parameter
初頭我都唔明
後黎聽albert講番,話有個code smell係將來會有人export左個variable出去
變左成部機既job都睇到個password
丫….你咁講又好似有D道理
雖然呢D事情大家都知應該唔會發生,就算發生左都應該無乜影響
不過可以執正既野就應該執正番
於是用spring datasource 既injector 塞左一堆keystore / truststore 入去, 用黎比oracle pki用
跟住到另一個要用truststore既restful service死左
呢個restful service我抄左人地用REST template去做
其實rest template set truststore唔難
spring預左大家用httpclient黎整rest template factory
不過本公司話ban左apache httpclient
認真做既話,其實自己爆開httpclient 既jar, 睇下佢D code點寫,然後自己implement番一次出黎都無話唔得既
反正httpclient都只係extends java.net
不過…無謂啦…
然後搵用另一個方法
比我搵到用spring-integration-ip, 可以create定SSL context, 再指佢落某一個tcp connection
嘩其實呢個真係fit曬
不過唔知點解我add 左maven dependency之後, eclipse死都話load唔到個xdd validate唔到我個applicationContext.xml
唔理,照build照試…其實係行到既
又到spring bean initialisation既次序問題
果個restful service initialize完即刻會call自己一次…但係睇黎佢call果下就未行到default SSL context(?)
結果都係唔wor
最後,用番D低能方法…. disable左個自動call自己一次既功能先,然後用番KeyManager set入去
諗諗下,其實disable左自己call自己一次之後,用spring-integration-ip應該都得架wor….
Recent Comments