Zum Inhalt springen

Benutzer:MovGP0/Programmierung

aus Wikipedia, der freien Enzyklopädie
Dies ist eine alte Version dieser Seite, zuletzt bearbeitet am 26. September 2013 um 12:22 Uhr durch MovGP0 (Diskussion | Beiträge) (/* Self-Signed Zertifikat für IIS {{Internetquelle|url=http://msdn.microsoft.com/en-us/library/ff648498.aspx|titel=How to: Create and Install Temporary Certificates in WCF for Transport Security During Development|werk=Developer Network|hrsg=Microsoft…). Sie kann sich erheblich von der aktuellen Version unterscheiden.
   MovGP0        Über mich        Hilfen        Artikel        Weblinks        Literatur        Zitate        Notizen        Programmierung      


Testing-Begriffe

Dummy object
is passed around but never actually used. Usually they are just used to fill parameter lists.
Fake object
actually have working implementations, but usually take some shortcut which makes them not suitable for production (an in memory database is a good example).
Stub
provide canned answers to calls made during the test, usually not responding at all to anything outside what's programmed in for the test. Stubs may also record information about calls, such as an email gateway stub that remembers the messages it 'sent', or maybe only how many messages it 'sent'.
Mock
objects pre-programmed with expectations which form a specification of the calls they are expected to receive.

Versionsverwaltung

Tools

Powershell

Filtert SVN Ausdrücke
svn st | where {$_ -match "(?=[?|!]).*"} | ?{$_ -notMatch ".*(bin\\[D|d]ebug).*"} | ?{$_ -notMatch ".*(obj\\[D|d]ebug).*"}
Finden von fälschlich eingestellten Binaries
svn list -R | ?{$_ -match ".*[(bin\\[D|d]ebug)|(obj\\[D|d]ebug)|(bin\\[R|r]elease)|(obj\\[R|r]elease)].*"}
Get-ChildItem -Recurse| ?{$_ -match ".*(\\[(bin)|(obj)]\\).*"}
Setzt Ignore-Flag
svn propset svn ignore FILE_OR_DIRECTORY
Findet Dateien nach Name
Get-ChildItem -Path "C:\." -Filter FileName.txt -Recurse
Setzt Umgebungsvariable
# get the correct directory
$programPath = if ( (${env:ProgramFiles(x86)}).Length -eq 0) { ${env:ProgramFiles} } else { ${env:ProgramFiles(x86) } }

# create the path to add to the path variable 
$pathToAdd = "$programPath\Java\jdk1.6.0_03\bin"

# get the current value for path 
$currentPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path

# create the new value for path
$newPath = "$currentPath;$pathToAdd" 

# variant1: set the path with the registry provider
Set-ItemProperty -Path 'Registry::HKLM\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH Value $newPath 

# variant2: set the path with the .NET framework  
[Environment]::SetEnvironmentVariable
     ( "Path", $newPath, [System.EnvironmentVariableTarget]::Machine )

Note: use HKCU (HKEY_CURRENT_USER) instead of HKLM (HKEY_LOCAL_MACHINE) when you want to set the variable only for the current user. That is 'User' instead of 'Machine' in the .NET variant. 

x64 oder x32 Programm?
dumpbin /headers PROGRAMMODERDLL

SSL Zertifikat generieren

SelfSSL7[1]
selfssl /N "cn=localhost;cn=example.com" /V "EXPIRATIONTIMEINDAYS" /I /S "IISSITENAME" /X /F "KEYLOCATION\key.pfx" /W "PASSWORD" /T
Makecert
makecert -r -n "CN=localhost" -b 01/01/2000 -e 01/01/2099 -eku 1.3.6.1.5.5.7.3.3 -sv localhost.pvk localhost.cer
cert2spc localhost.cer localhost.spc
pvk2pfx -pvk localhost.pvk -spc localhost.spc -pfx localhost.pfx
OpenSSL
openssl genrsa -out localhost.key 2048
openssl req -new -x509 -key localhost.key -out localhost.cert -days 3650 -subj /CN=localhost

Self-Signed Zertifikat für IIS [2]

Root-Zertifikat erstellen
  • makecert -n "CN=root.lan.ddg" -r -sv root.pvk root.cer
    
  • Zertifikat öffnen und nach Trusted Root Certification Authorities importieren
Server-Zertifikat erstellen und in IIS importieren
  • makecert -sk "Local Certificate" -iv root.pvk -n "CN=localhost" -ic root.cer -sr localmachine -ss my -sky exchange -pe
    

Anschließend in IIS das Binding der Website ändern, so dass das neue Zertifikat verwendet wird.

start inetmgr

Einzelnachweise

  1. Setting up SSL made easy… In: IIS Blog. 16. April 2010, abgerufen am 26. September 2013.
  2. How to: Create and Install Temporary Certificates in WCF for Transport Security During Development. In: Developer Network. Microsoft, abgerufen am 26. September 2013 (englisch).